coverage-report

Code coverage report for All files

npmtest-bower (v0.0.1)

Code coverage report for All files

Statements: 40.41% (3036 / 7513)      Branches: 15.66% (565 / 3607)      Functions: 15.49% (187 / 1207)      Lines: 40.95% (3019 / 7373)      Ignored: 26 statements, 1 function, 30 branches     

File Statements Branches Functions Lines
node-npmtest-bower/ 100% (153 / 153) 100% (126 / 126) 100% (28 / 28) 100% (153 / 153)
node-npmtest-bower/node_modules/bower/lib/ 78.38% (29 / 37) 53.85% (7 / 13) 40% (2 / 5) 78.38% (29 / 37)
node-npmtest-bower/node_modules/bower/lib/commands/ 33.33% (10 / 30) 100% (0 / 0) 12.5% (1 / 8) 33.33% (10 / 30)
node-npmtest-bower/node_modules/bower/lib/node_modules/abbrev/ 82.86% (29 / 35) 83.33% (20 / 24) 40% (2 / 5) 85.29% (29 / 34)
node-npmtest-bower/node_modules/bower/lib/node_modules/balanced-match/ 14.29% (5 / 35) 0% (0 / 26) 0% (0 / 3) 15.15% (5 / 33)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/ 74.14% (43 / 58) 31.25% (5 / 16) 53.85% (7 / 13) 74.14% (43 / 58)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/ 58.65% (122 / 208) 45.58% (67 / 147) 66.67% (14 / 21) 58.94% (122 / 207)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/ 100% (3 / 3) 100% (0 / 0) 100% (0 / 0) 100% (3 / 3)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/ 27.01% (37 / 137) 0% (0 / 68) 0% (0 / 15) 27.01% (37 / 137)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/ 57.69% (15 / 26) 37.5% (3 / 8) 12.5% (1 / 8) 57.69% (15 / 26)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/ 58.77% (134 / 228) 14.13% (13 / 92) 22.73% (10 / 44) 59.82% (134 / 224)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/math/ 66.67% (2 / 3) 0% (0 / 4) 0% (0 / 1) 66.67% (2 / 3)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/number/ 66.67% (4 / 6) 0% (0 / 2) 0% (0 / 2) 66.67% (4 / 6)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/ 49.72% (178 / 358) 9.02% (11 / 122) 14.71% (10 / 68) 49.86% (177 / 355)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/ 51.94% (161 / 310) 1.32% (1 / 76) 12.2% (5 / 41) 51.94% (161 / 310)
node-npmtest-bower/node_modules/bower/lib/node_modules/bower-logger/lib/ 22.86% (16 / 70) 0% (0 / 18) 6.67% (1 / 15) 22.86% (16 / 70)
node-npmtest-bower/node_modules/bower/lib/node_modules/brace-expansion/ 17.27% (19 / 110) 0% (0 / 55) 0% (0 / 13) 17.59% (19 / 108)
node-npmtest-bower/node_modules/bower/lib/node_modules/concat-map/ 20% (2 / 10) 25% (1 / 4) 0% (0 / 2) 22.22% (2 / 9)
node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/ 56.14% (32 / 57) 33.33% (8 / 24) 30% (3 / 10) 56.14% (32 / 57)
node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/node_modules/object-assign/ 48.84% (21 / 43) 25% (5 / 20) 60% (3 / 5) 48.84% (21 / 43)
node-npmtest-bower/node_modules/bower/lib/node_modules/dot-prop/ 10.91% (6 / 55) 0% (0 / 38) 0% (0 / 5) 10.91% (6 / 55)
node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/lib/ 89.47% (17 / 19) 62.5% (5 / 8) 75% (3 / 4) 88.89% (16 / 18)
node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/ 27.64% (228 / 825) 13.62% (73 / 536) 19.72% (14 / 71) 27.7% (228 / 823)
node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/ 36.61% (164 / 448) 14.22% (33 / 232) 24.14% (21 / 87) 38.07% (158 / 415)
node-npmtest-bower/node_modules/bower/lib/node_modules/imurmurhash/ 91.3% (63 / 69) 68.57% (24 / 35) 100% (5 / 5) 91.3% (63 / 69)
node-npmtest-bower/node_modules/bower/lib/node_modules/inflight/ 24.14% (7 / 29) 0% (0 / 4) 0% (0 / 5) 25% (7 / 28)
node-npmtest-bower/node_modules/bower/lib/node_modules/inherits/ 66.67% (4 / 6) 50% (1 / 2) 100% (0 / 0) 80% (4 / 5)
node-npmtest-bower/node_modules/bower/lib/node_modules/is-obj/ 33.33% (1 / 3) 0% (0 / 3) 0% (0 / 1) 33.33% (1 / 3)
node-npmtest-bower/node_modules/bower/lib/node_modules/minimatch/ 30.21% (129 / 427) 16.92% (44 / 260) 38.24% (13 / 34) 31.76% (128 / 403)
node-npmtest-bower/node_modules/bower/lib/node_modules/minimist/ 18.87% (20 / 106) 4.44% (4 / 90) 5.88% (1 / 17) 19.61% (20 / 102)
node-npmtest-bower/node_modules/bower/lib/node_modules/mkdirp/ 38.6% (22 / 57) 21.43% (9 / 42) 16.67% (1 / 6) 40.38% (21 / 52)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/ 100% (13 / 13) 100% (0 / 0) 100% (0 / 0) 100% (13 / 13)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/ 29.73% (157 / 528) 0% (0 / 207) 0% (0 / 67) 29.79% (157 / 527)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/ 67.86% (57 / 84) 0% (0 / 16) 9.09% (1 / 11) 67.86% (57 / 84)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/ 27.88% (75 / 269) 0% (0 / 156) 0% (0 / 33) 28.2% (75 / 266)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/i18n/ 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/ 36.8% (46 / 125) 0% (0 / 22) 0% (0 / 32) 36.8% (46 / 125)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/ 50.88% (116 / 228) 4.35% (4 / 92) 4.55% (2 / 44) 51.79% (116 / 224)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/ 54.55% (24 / 44) 0% (0 / 26) 0% (0 / 11) 54.55% (24 / 44)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/ 45.98% (40 / 87) 0% (0 / 44) 0% (0 / 13) 47.06% (40 / 85)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/ 46.65% (167 / 358) 5.83% (7 / 120) 11.76% (8 / 68) 46.76% (166 / 355)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/ 37.88% (25 / 66) 0% (0 / 28) 0% (0 / 9) 37.88% (25 / 66)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/ 60.61% (40 / 66) 0% (0 / 28) 0% (0 / 10) 60.61% (40 / 66)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/ 47.42% (147 / 310) 0% (0 / 76) 0% (0 / 41) 47.42% (147 / 310)
node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/ 43.75% (14 / 32) 4% (1 / 25) 0% (0 / 6) 43.75% (14 / 32)
node-npmtest-bower/node_modules/bower/lib/node_modules/once/ 53.85% (7 / 13) 0% (0 / 2) 25% (1 / 4) 58.33% (7 / 12)
node-npmtest-bower/node_modules/bower/lib/node_modules/optimist/ 33.72% (58 / 172) 14.95% (16 / 107) 19.44% (7 / 36) 35% (56 / 160)
node-npmtest-bower/node_modules/bower/lib/node_modules/os-homedir/ 23.08% (3 / 13) 3.57% (1 / 28) 0% (0 / 1) 23.08% (3 / 13)
node-npmtest-bower/node_modules/bower/lib/node_modules/os-tmpdir/ 30% (3 / 10) 6.67% (1 / 15) 0% (0 / 1) 30% (3 / 10)
node-npmtest-bower/node_modules/bower/lib/node_modules/osenv/ 63.41% (26 / 41) 16.67% (6 / 36) 41.67% (5 / 12) 68.42% (26 / 38)
node-npmtest-bower/node_modules/bower/lib/node_modules/path-is-absolute/ 54.55% (6 / 11) 12.5% (1 / 8) 50% (1 / 2) 54.55% (6 / 11)
node-npmtest-bower/node_modules/bower/lib/node_modules/q/ 28.19% (221 / 784) 9.29% (25 / 269) 3.6% (8 / 222) 28.26% (221 / 782)
node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/ 19.7% (13 / 66) 0% (0 / 40) 0% (0 / 13) 23.08% (12 / 52)
node-npmtest-bower/node_modules/bower/lib/node_modules/untildify/ 83.33% (5 / 6) 50% (2 / 4) 100% (1 / 1) 83.33% (5 / 6)
node-npmtest-bower/node_modules/bower/lib/node_modules/uuid/ 29.49% (23 / 78) 0% (0 / 54) 16.67% (1 / 6) 29.49% (23 / 78)
node-npmtest-bower/node_modules/bower/lib/node_modules/wordwrap/ 7.14% (3 / 42) 0% (0 / 22) 0% (0 / 7) 7.5% (3 / 40)
node-npmtest-bower/node_modules/bower/lib/node_modules/wrappy/ 36.84% (7 / 19) 40% (4 / 10) 25% (1 / 4) 38.89% (7 / 18)
node-npmtest-bower/node_modules/bower/lib/node_modules/write-file-atomic/ 57.41% (31 / 54) 27.66% (13 / 47) 37.5% (3 / 8) 59.57% (28 / 47)
node-npmtest-bower/node_modules/bower/lib/node_modules/xdg-basedir/ 100% (14 / 14) 72.73% (16 / 22) 100% (0 / 0) 100% (14 / 14)
node-npmtest-bower/node_modules/bower/lib/util/ 100% (18 / 18) 100% (8 / 8) 100% (3 / 3) 100% (18 / 18)
Code coverage report for node-npmtest-bower/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/

Statements: 100% (153 / 153)      Branches: 100% (126 / 126)      Functions: 100% (28 / 28)      Lines: 100% (153 / 153)      Ignored: 26 statements, 1 function, 30 branches     

All files » node-npmtest-bower/
File Statements Branches Functions Lines
example.js 100% (83 / 83) 100% (73 / 73) 100% (12 / 12) 100% (83 / 83)
lib.npmtest_bower.js 100% (16 / 16) 100% (14 / 14) 100% (3 / 3) 100% (16 / 16)
test.js 100% (54 / 54) 100% (39 / 39) 100% (13 / 13) 100% (54 / 54)
Code coverage report for node-npmtest-bower/example.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/example.js

Statements: 100% (83 / 83)      Branches: 100% (73 / 73)      Functions: 100% (12 / 12)      Lines: 100% (83 / 83)      Ignored: 26 statements, 1 function, 30 branches     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328                                                  2   2         2   2   2 2 2         1             2       2       2   2               1 2           2     2     2 2   1       2     1 1 1   1 1     1 1   1     1   2           1   1   1         1 2 2 3 3 3 3 1     3 3         3       1 3 1       1 1               1   1 1 1   1   1                                                                                                                                                                                       1 1                       1     6 6   1   2   1   2         1 1   1         1             1     1 1     1 1   1 1 1 1 1 1 1   1 1   1        
/*
example.js
 
quickstart example
 
instruction
    1. save this script as example.js
    2. run the shell command:
        $ npm install npmtest-bower && PORT=8081 node example.js
    3. play with the browser-demo on http://127.0.0.1:8081
*/
 
 
 
/* istanbul instrument in package npmtest_bower */
/*jslint
    bitwise: true,
    browser: true,
    maxerr: 8,
    maxlen: 96,
    node: true,
    nomen: true,
    regexp: true,
    stupid: true
*/
(function () {
    'use strict';
    var local;
 
 
 
    // run shared js-env code - pre-init
    (function () {
        // init local
        local = {};
        // init modeJs
        local.modeJs = (function () {
            try {
                return typeof navigator.userAgent === 'string' &&
                    typeof document.querySelector('body') === 'object' &&
                    typeof XMLHttpRequest.prototype.open === 'function' &&
                    'browser';
            } catch (errorCaughtBrowser) {
                return module.exports &&
                    typeof process.versions.node === 'string' &&
                    typeof require('http').createServer === 'function' &&
                    'node';
            }
        }());
        // init global
        local.global = local.modeJs === 'browser'
            ? window
            : global;
        // init utility2_rollup
        local = local.global.utility2_rollup || (local.modeJs === 'browser'
            ? local.global.utility2_npmtest_bower
            : global.utility2_moduleExports);
        // export local
        local.global.local = local;
    }());
    switch (local.modeJs) {
 
 
 
    // post-init
    // run browser js-env code - post-init
    /* istanbul ignore next */
    case 'browser':
        local.testRunBrowser = function (event) {
            Eif (!event || (event &&
                    event.currentTarget &&
                    event.currentTarget.className &&
                    event.currentTarget.className.includes &&
                    event.currentTarget.className.includes('onreset'))) {
                // reset output
                Array.from(
                    document.querySelectorAll('body > .resettable')
                ).forEach(function (element) {
                    switch (element.tagName) {
                    case 'INPUT':
                    case 'TEXTAREA':
                        element.value = '';
                        break;
                    default:
                        element.textContent = '';
                    }
                });
            }
            switch (event && event.currentTarget && event.currentTarget.id) {
            case 'testRunButton1':
                // show tests
                Eif (document.querySelector('#testReportDiv1').style.display === 'none') {
                    document.querySelector('#testReportDiv1').style.display = 'block';
                    document.querySelector('#testRunButton1').textContent =
                        'hide internal test';
                    local.modeTest = true;
                    local.testRunDefault(local);
                // hide tests
                } else {
                    document.querySelector('#testReportDiv1').style.display = 'none';
                    document.querySelector('#testRunButton1').textContent = 'run internal test';
                }
                break;
            // custom-case
            default:
                break;
            }
            Iif (document.querySelector('#inputTextareaEval1') && (!event || (event &&
                    event.currentTarget &&
                    event.currentTarget.className &&
                    event.currentTarget.className.includes &&
                    event.currentTarget.className.includes('oneval')))) {
                // try to eval input-code
                try {
                    /*jslint evil: true*/
                    eval(document.querySelector('#inputTextareaEval1').value);
                } catch (errorCaught) {
                    console.error(errorCaught);
                }
            }
        };
        // log stderr and stdout to #outputTextareaStdout1
        ['error', 'log'].forEach(function (key) {
            console[key + '_original'] = console[key];
            console[key] = function () {
                var element;
                console[key + '_original'].apply(console, arguments);
                element = document.querySelector('#outputTextareaStdout1');
                Iif (!element) {
                    return;
                }
                // append text to #outputTextareaStdout1
                element.value += Array.from(arguments).map(function (arg) {
                    return typeof arg === 'string'
                        ? arg
                        : JSON.stringify(arg, null, 4);
                }).join(' ') + '\n';
                // scroll textarea to bottom
                element.scrollTop = element.scrollHeight;
            };
        });
        // init event-handling
        ['change', 'click', 'keyup'].forEach(function (event) {
            Array.from(document.querySelectorAll('.on' + event)).forEach(function (element) {
                element.addEventListener(event, local.testRunBrowser);
            });
        });
        // run tests
        local.testRunBrowser();
        break;
 
 
 
    // run node js-env code - post-init
    /* istanbul ignore next */
    case 'node':
        // export local
        module.exports = local;
        // require modules
        local.fs = require('fs');
        local.http = require('http');
        local.url = require('url');
        // init assets
        local.assetsDict = local.assetsDict || {};
        /* jslint-ignore-begin */
        local.assetsDict['/assets.index.template.html'] = '\
<!doctype html>\n\
<html lang="en">\n\
<head>\n\
<meta charset="UTF-8">\n\
<meta name="viewport" content="width=device-width, initial-scale=1">\n\
<title>{{env.npm_package_name}} (v{{env.npm_package_version}})</title>\n\
<style>\n\
/*csslint\n\
    box-sizing: false,\n\
    universal-selector: false\n\
*/\n\
* {\n\
    box-sizing: border-box;\n\
}\n\
body {\n\
    background: #dde;\n\
    font-family: Arial, Helvetica, sans-serif;\n\
    margin: 2rem;\n\
}\n\
body > * {\n\
    margin-bottom: 1rem;\n\
}\n\
.utility2FooterDiv {\n\
    margin-top: 20px;\n\
    text-align: center;\n\
}\n\
</style>\n\
<style>\n\
/*csslint\n\
*/\n\
textarea {\n\
    font-family: monospace;\n\
    height: 10rem;\n\
    width: 100%;\n\
}\n\
textarea[readonly] {\n\
    background: #ddd;\n\
}\n\
</style>\n\
</head>\n\
<body>\n\
<!-- utility2-comment\n\
<div id="ajaxProgressDiv1" style="background: #d00; height: 2px; left: 0; margin: 0; padding: 0; position: fixed; top: 0; transition: background 0.5s, width 1.5s; width: 25%;"></div>\n\
utility2-comment -->\n\
<h1>\n\
<!-- utility2-comment\n\
    <a\n\
        {{#if env.npm_package_homepage}}\n\
        href="{{env.npm_package_homepage}}"\n\
        {{/if env.npm_package_homepage}}\n\
        target="_blank"\n\
    >\n\
utility2-comment -->\n\
        {{env.npm_package_name}} (v{{env.npm_package_version}})\n\
<!-- utility2-comment\n\
    </a>\n\
utility2-comment -->\n\
</h1>\n\
<h3>{{env.npm_package_description}}</h3>\n\
<!-- utility2-comment\n\
<h4><a download href="assets.app.js">download standalone app</a></h4>\n\
<button class="onclick onreset" id="testRunButton1">run internal test</button><br>\n\
<div id="testReportDiv1" style="display: none;"></div>\n\
utility2-comment -->\n\
\n\
\n\
\n\
<label>stderr and stdout</label>\n\
<textarea class="resettable" id="outputTextareaStdout1" readonly></textarea>\n\
<!-- utility2-comment\n\
{{#if isRollup}}\n\
<script src="assets.app.js"></script>\n\
{{#unless isRollup}}\n\
utility2-comment -->\n\
<script src="assets.utility2.rollup.js"></script>\n\
<script src="jsonp.utility2._stateInit?callback=window.utility2._stateInit"></script>\n\
<script src="assets.npmtest_bower.rollup.js"></script>\n\
<script src="assets.example.js"></script>\n\
<script src="assets.test.js"></script>\n\
<!-- utility2-comment\n\
{{/if isRollup}}\n\
utility2-comment -->\n\
<div class="utility2FooterDiv">\n\
    [ this app was created with\n\
    <a href="https://github.com/kaizhu256/node-utility2" target="_blank">utility2</a>\n\
    ]\n\
</div>\n\
</body>\n\
</html>\n\
';
        /* jslint-ignore-end */
        Iif (local.templateRender) {
            local.assetsDict['/'] = local.templateRender(
                local.assetsDict['/assets.index.template.html'],
                {
                    env: local.objectSetDefault(local.env, {
                        npm_package_description: 'the greatest app in the world!',
                        npm_package_name: 'my-app',
                        npm_package_nameAlias: 'my_app',
                        npm_package_version: '0.0.1'
                    })
                }
            );
        } else {
            local.assetsDict['/'] = local.assetsDict['/assets.index.template.html']
                .replace((/\{\{env\.(\w+?)\}\}/g), function (match0, match1) {
                    // jslint-hack
                    String(match0);
                    switch (match1) {
                    case 'npm_package_description':
                        return 'the greatest app in the world!';
                    case 'npm_package_name':
                        return 'my-app';
                    case 'npm_package_nameAlias':
                        return 'my_app';
                    case 'npm_package_version':
                        return '0.0.1';
                    }
                });
        }
        // run the cli
        Eif (local.global.utility2_rollup || module !== require.main) {
            break;
        }
        local.assetsDict['/assets.example.js'] =
            local.assetsDict['/assets.example.js'] ||
            local.fs.readFileSync(__filename, 'utf8');
        // bug-workaround - long $npm_package_buildCustomOrg
        /* jslint-ignore-begin */
        local.assetsDict['/assets.npmtest_bower.rollup.js'] =
            local.assetsDict['/assets.npmtest_bower.rollup.js'] ||
            local.fs.readFileSync(
                local.npmtest_bower.__dirname + '/lib.npmtest_bower.js',
                'utf8'
            ).replace((/^#!/), '//');
        /* jslint-ignore-end */
        local.assetsDict['/favicon.ico'] = local.assetsDict['/favicon.ico'] || '';
        // if $npm_config_timeout_exit exists,
        // then exit this process after $npm_config_timeout_exit ms
        if (Number(process.env.npm_config_timeout_exit)) {
            setTimeout(process.exit, Number(process.env.npm_config_timeout_exit));
        }
        // start server
        if (local.global.utility2_serverHttp1) {
            break;
        }
        process.env.PORT = process.env.PORT || '8081';
        console.error('server starting on port ' + process.env.PORT);
        local.http.createServer(function (request, response) {
            request.urlParsed = local.url.parse(request.url);
            if (local.assetsDict[request.urlParsed.pathname] !== undefined) {
                response.end(local.assetsDict[request.urlParsed.pathname]);
                return;
            }
            response.statusCode = 404;
            response.end();
        }).listen(process.env.PORT);
        break;
    }
}());
 
 
Code coverage report for node-npmtest-bower/lib.npmtest_bower.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/lib.npmtest_bower.js

Statements: 100% (16 / 16)      Branches: 100% (14 / 14)      Functions: 100% (3 / 3)      Lines: 100% (16 / 16)      Ignored: none     

All files » node-npmtest-bower/ » lib.npmtest_bower.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55                      2   2         2   2   2 2 2         1             2       2   2   2 1   1 1 1          
/* istanbul instrument in package npmtest_bower */
/*jslint
    bitwise: true,
    browser: true,
    maxerr: 8,
    maxlen: 96,
    node: true,
    nomen: true,
    regexp: true,
    stupid: true
*/
(function () {
    'use strict';
    var local;
 
 
 
    // run shared js-env code - pre-init
    (function () {
        // init local
        local = {};
        // init modeJs
        local.modeJs = (function () {
            try {
                return typeof navigator.userAgent === 'string' &&
                    typeof document.querySelector('body') === 'object' &&
                    typeof XMLHttpRequest.prototype.open === 'function' &&
                    'browser';
            } catch (errorCaughtBrowser) {
                return module.exports &&
                    typeof process.versions.node === 'string' &&
                    typeof require('http').createServer === 'function' &&
                    'node';
            }
        }());
        // init global
        local.global = local.modeJs === 'browser'
            ? window
            : global;
        // init utility2_rollup
        local = local.global.utility2_rollup || local;
        // init lib
        local.local = local.npmtest_bower = local;
        // init exports
        if (local.modeJs === 'browser') {
            local.global.utility2_npmtest_bower = local;
        } else {
            module.exports = local;
            module.exports.__dirname = __dirname;
            module.exports.module = module;
        }
    }());
}());
 
 
Code coverage report for node-npmtest-bower/test.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/test.js

Statements: 100% (54 / 54)      Branches: 100% (39 / 39)      Functions: 100% (13 / 13)      Lines: 100% (54 / 54)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197                      2   2         2   2   2 2 2         1             2     2     1       1     1   1     2           2 2   2           1           1           2 2   2           1             1       1     1             1             1 1     1             1 1 1 1 1 1     1         2 2     1             2 2     1             2 2     1             2 2     1             1 1       1 1        
/* istanbul instrument in package npmtest_bower */
/*jslint
    bitwise: true,
    browser: true,
    maxerr: 8,
    maxlen: 96,
    node: true,
    nomen: true,
    regexp: true,
    stupid: true
*/
(function () {
    'use strict';
    var local;
 
 
 
    // run shared js-env code - pre-init
    (function () {
        // init local
        local = {};
        // init modeJs
        local.modeJs = (function () {
            try {
                return typeof navigator.userAgent === 'string' &&
                    typeof document.querySelector('body') === 'object' &&
                    typeof XMLHttpRequest.prototype.open === 'function' &&
                    'browser';
            } catch (errorCaughtBrowser) {
                return module.exports &&
                    typeof process.versions.node === 'string' &&
                    typeof require('http').createServer === 'function' &&
                    'node';
            }
        }());
        // init global
        local.global = local.modeJs === 'browser'
            ? window
            : global;
        switch (local.modeJs) {
        // re-init local from window.local
        case 'browser':
            local = local.global.utility2.objectSetDefault(
                local.global.utility2_rollup || local.global.local,
                local.global.utility2
            );
            break;
        // re-init local from example.js
        case 'node':
            local = (local.global.utility2_rollup || require('utility2'))
                .requireExampleJsFromReadme();
            break;
        }
        // export local
        local.global.local = local;
    }());
 
 
 
    // run shared js-env code - function
    (function () {
        return;
    }());
    switch (local.modeJs) {
 
 
 
    // run browser js-env code - function
    case 'browser':
        break;
 
 
 
    // run node js-env code - function
    case 'node':
        break;
    }
 
 
 
    // run shared js-env code - post-init
    (function () {
        return;
    }());
    switch (local.modeJs) {
 
 
 
    // run browser js-env code - post-init
    case 'browser':
        local.testCase_browser_nullCase = local.testCase_browser_nullCase || function (
            options,
            onError
        ) {
        /*
         * this function will test browsers's null-case handling-behavior-behavior
         */
            onError(null, options);
        };
 
        // run tests
        local.nop(local.modeTest &&
            document.querySelector('#testRunButton1') &&
            document.querySelector('#testRunButton1').click());
        break;
 
 
 
    // run node js-env code - post-init
    /* istanbul ignore next */
    case 'node':
        local.testCase_buildApidoc_default = local.testCase_buildApidoc_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildApidoc's default handling-behavior-behavior
         */
            options = { modulePathList: module.paths };
            local.buildApidoc(options, onError);
        };
 
        local.testCase_buildApp_default = local.testCase_buildApp_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildApp's default handling-behavior-behavior
         */
            local.testCase_buildReadme_default(options, local.onErrorThrow);
            local.testCase_buildLib_default(options, local.onErrorThrow);
            local.testCase_buildTest_default(options, local.onErrorThrow);
            local.testCase_buildCustomOrg_default(options, local.onErrorThrow);
            options = [];
            local.buildApp(options, onError);
        };
 
        local.testCase_buildCustomOrg_default = local.testCase_buildCustomOrg_default ||
            function (options, onError) {
            /*
             * this function will test buildCustomOrg's default handling-behavior
             */
                options = {};
                local.buildCustomOrg(options, onError);
            };
 
        local.testCase_buildLib_default = local.testCase_buildLib_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildLib's default handling-behavior
         */
            options = {};
            local.buildLib(options, onError);
        };
 
        local.testCase_buildReadme_default = local.testCase_buildReadme_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildReadme's default handling-behavior-behavior
         */
            options = {};
            local.buildReadme(options, onError);
        };
 
        local.testCase_buildTest_default = local.testCase_buildTest_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildTest's default handling-behavior
         */
            options = {};
            local.buildTest(options, onError);
        };
 
        local.testCase_webpage_default = local.testCase_webpage_default || function (
            options,
            onError
        ) {
        /*
         * this function will test webpage's default handling-behavior
         */
            options = { modeCoverageMerge: true, url: local.serverLocalHost + '?modeTest=1' };
            local.browserTest(options, onError);
        };
 
        // run test-server
        local.testRunServer(local);
        break;
    }
}());
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/

Statements: 78.38% (29 / 37)      Branches: 53.85% (7 / 13)      Functions: 40% (2 / 5)      Lines: 78.38% (29 / 37)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/
File Statements Branches Functions Lines
config.js 78.57% (22 / 28) 53.85% (7 / 13) 50% (2 / 4) 78.57% (22 / 28)
index.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 1) 71.43% (5 / 7)
version.js 100% (2 / 2) 100% (0 / 0) 100% (0 / 0) 100% (2 / 2)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/config.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/config.js

Statements: 78.57% (22 / 28)      Branches: 53.85% (7 / 13)      Functions: 50% (2 / 4)      Lines: 78.57% (22 / 28)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 651 1 1 1   1   1 1   1     1 1   1   1   1     1 1               1                           1     1           1         1 1 1    
var tty = require('tty');
var object = require('mout').object;
var bowerConfig = require('bower-config');
var Configstore = require('configstore');
 
var current;
 
function defaultConfig(config) {
    config = config || {};
 
    return readCachedConfig(config.cwd || process.cwd(), config);
}
 
function readCachedConfig(cwd, overwrites) {
    current = bowerConfig.create(cwd).load(overwrites);
 
    var config = current.toObject();
 
    var configstore = new Configstore('bower-github').all;
 
    object.mixIn(config, configstore);
 
    // If interactive is auto (null), guess its value
    Eif (config.interactive == null) {
        config.interactive = (
            process.bin === 'bower' &&
            tty.isatty(1) &&
            !process.env.CI
        );
    }
 
    // Merge common CLI options into the config
    Iif (process.bin === 'bower') {
        var cli = require('./util/cli');
 
        object.mixIn(config, cli.readOptions({
            force: { type: Boolean, shorthand: 'f' },
            offline: { type: Boolean, shorthand: 'o' },
            verbose: { type: Boolean, shorthand: 'V' },
            quiet: { type: Boolean, shorthand: 'q' },
            loglevel: { type: String, shorthand: 'l' },
            json: { type: Boolean, shorthand: 'j' },
            silent: { type: Boolean, shorthand: 's' }
        }));
    }
 
    return config;
}
 
function restoreConfig() {
    if (current) {
        current.restore();
    }
}
 
function resetCache() {
    restoreConfig();
    current = undefined;
}
 
module.exports = defaultConfig;
module.exports.restore = restoreConfig;
module.exports.reset = resetCache;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/index.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1 1   1               1                
var commands = require('./commands');
var version = require('./version');
var abbreviations = require('./util/abbreviations')(commands);
 
function clearRuntimeCache() {
    // Note that in edge cases, some architecture components instance's
    // in-memory cache might be skipped.
    // If that's a problem, you should create and fresh instances instead.
    var PackageRepository = require('./core/PackageRepository');
    PackageRepository.clearRuntimeCache();
}
 
module.exports = {
    version: version,
    commands: commands,
    config: require('./config')(),
    abbreviations: abbreviations,
    reset: clearRuntimeCache
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/version.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/version.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (2 / 2)      Ignored: none     

1 2 3 4 51   1    
var findup = require('findup-sync');
 
module.exports = require(findup('package.json', { cwd: __dirname })).version;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/commands/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/commands/

Statements: 33.33% (10 / 30)      Branches: 100% (0 / 0)      Functions: 12.5% (1 / 8)      Lines: 33.33% (10 / 30)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/commands/
File Statements Branches Functions Lines
index.js 33.33% (10 / 30) 100% (0 / 0) 12.5% (1 / 8) 33.33% (10 / 30)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/commands/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/commands/index.js

Statements: 33.33% (10 / 30)      Branches: 100% (0 / 0)      Functions: 12.5% (1 / 8)      Lines: 33.33% (10 / 30)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 831 1 1                 1 1                     1                         1                                 18   18       1                                              
var Q = require('q');
var Logger = require('bower-logger');
var config = require('../config');
 
/**
 * Require commands only when called.
 *
 * Running `commandFactory(id)` is equivalent to `require(id)`. Both calls return
 * a command function. The difference is that `cmd = commandFactory()` and `cmd()`
 * return as soon as possible and load and execute the command asynchronously.
 */
function commandFactory(id) {
    function runApi() {
        var command = require(id);
        var commandArgs = [].slice.call(arguments);
 
        return withLogger(function (logger) {
            commandArgs.unshift(logger);
 
            return command.apply(undefined, commandArgs);
        });
    }
 
    function runFromArgv(argv) {
        var commandArgs;
        var command = require(id);
 
        commandArgs = command.readOptions(argv);
 
        return withLogger(function (logger) {
            commandArgs.unshift(logger);
 
            return command.apply(undefined, commandArgs);
        });
    }
 
    function withLogger(func) {
        var logger = new Logger();
 
        Q.try(func, logger)
        .done(function () {
            config.restore();
            var args = [].slice.call(arguments);
            args.unshift('end');
            logger.emit.apply(logger, args);
        }, function (error) {
            config.restore();
            logger.emit('error', error);
        });
 
        return logger;
    }
 
    runApi.line = runFromArgv;
 
    return runApi;
}
 
 
module.exports = {
    cache: {
        clean: commandFactory('./cache/clean'),
        list: commandFactory('./cache/list'),
    },
    help: commandFactory('./help'),
    home: commandFactory('./home'),
    info: commandFactory('./info'),
    init: commandFactory('./init'),
    install: commandFactory('./install'),
    link: commandFactory('./link'),
    list: commandFactory('./list'),
    login: commandFactory('./login'),
    lookup: commandFactory('./lookup'),
    prune: commandFactory('./prune'),
    register: commandFactory('./register'),
    search: commandFactory('./search'),
    update: commandFactory('./update'),
    uninstall: commandFactory('./uninstall'),
    unregister: commandFactory('./unregister'),
    version: commandFactory('./version')
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/abbrev/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/abbrev/

Statements: 82.86% (29 / 35)      Branches: 83.33% (20 / 24)      Functions: 40% (2 / 5)      Lines: 85.29% (29 / 34)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/abbrev/
File Statements Branches Functions Lines
abbrev.js 82.86% (29 / 35) 83.33% (20 / 24) 40% (2 / 5) 85.29% (29 / 34)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/abbrev/abbrev.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/abbrev/abbrev.js

Statements: 82.86% (29 / 35)      Branches: 83.33% (20 / 24)      Functions: 40% (2 / 5)      Lines: 85.29% (29 / 34)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64  1   1   1                       1 1     1 19       1     1   1 19       19 19 56 56 56 56 18 18     19 19 1 1   18 81 81     1     1 44      
 
module.exports = exports = abbrev.abbrev = abbrev
 
abbrev.monkeyPatch = monkeyPatch
 
function monkeyPatch () {
  Object.defineProperty(Array.prototype, 'abbrev', {
    value: function () { return abbrev(this) },
    enumerable: false, configurable: true, writable: true
  })
 
  Object.defineProperty(Object.prototype, 'abbrev', {
    value: function () { return abbrev(Object.keys(this)) },
    enumerable: false, configurable: true, writable: true
  })
}
 
function abbrev (list) {
  Iif (arguments.length !== 1 || !Array.isArray(list)) {
    list = Array.prototype.slice.call(arguments, 0)
  }
  for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
    args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
  }
 
  // sort them lexicographically, so that they're next to their nearest kin
  args = args.sort(lexSort)
 
  // walk through each, seeing how much it has in common with the next and previous
  var abbrevs = {}
    , prev = ""
  for (var i = 0, l = args.length ; i < l ; i ++) {
    var current = args[i]
      , next = args[i + 1] || ""
      , nextMatches = true
      , prevMatches = true
    Iif (current === next) continue
    for (var j = 0, cl = current.length ; j < cl ; j ++) {
      var curChar = current.charAt(j)
      nextMatches = nextMatches && curChar === next.charAt(j)
      prevMatches = prevMatches && curChar === prev.charAt(j)
      if (!nextMatches && !prevMatches) {
        j ++
        break
      }
    }
    prev = current
    if (j === cl) {
      abbrevs[current] = current
      continue
    }
    for (var a = current.substr(0, j) ; j <= cl ; j ++) {
      abbrevs[a] = current
      a += current.charAt(j)
    }
  }
  return abbrevs
}
 
function lexSort (a, b) {
  return a === b ? 0 : a > b ? 1 : -1
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/balanced-match/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/balanced-match/

Statements: 14.29% (5 / 35)      Branches: 0% (0 / 26)      Functions: 0% (0 / 3)      Lines: 15.15% (5 / 33)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/balanced-match/
File Statements Branches Functions Lines
index.js 14.29% (5 / 35) 0% (0 / 26) 0% (0 / 3) 15.15% (5 / 33)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/balanced-match/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/balanced-match/index.js

Statements: 14.29% (5 / 35)      Branches: 0% (0 / 26)      Functions: 0% (0 / 3)      Lines: 15.15% (5 / 33)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 601 1                             1         1 1                                                                          
module.exports = balanced;
function balanced(a, b, str) {
  if (a instanceof RegExp) a = maybeMatch(a, str);
  if (b instanceof RegExp) b = maybeMatch(b, str);
 
  var r = range(a, b, str);
 
  return r && {
    start: r[0],
    end: r[1],
    pre: str.slice(0, r[0]),
    body: str.slice(r[0] + a.length, r[1]),
    post: str.slice(r[1] + b.length)
  };
}
 
function maybeMatch(reg, str) {
  var m = str.match(reg);
  return m ? m[0] : null;
}
 
balanced.range = range;
function range(a, b, str) {
  var begs, beg, left, right, result;
  var ai = str.indexOf(a);
  var bi = str.indexOf(b, ai + 1);
  var i = ai;
 
  if (ai >= 0 && bi > 0) {
    begs = [];
    left = str.length;
 
    while (i >= 0 && !result) {
      if (i == ai) {
        begs.push(i);
        ai = str.indexOf(a, i + 1);
      } else if (begs.length == 1) {
        result = [ begs.pop(), bi ];
      } else {
        beg = begs.pop();
        if (beg < left) {
          left = beg;
          right = bi;
        }
 
        bi = str.indexOf(b, i + 1);
      }
 
      i = ai < bi && ai >= 0 ? ai : bi;
    }
 
    if (begs.length) {
      result = [ left, right ];
    }
  }
 
  return result;
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/

Statements: 74.14% (43 / 58)      Branches: 31.25% (5 / 16)      Functions: 53.85% (7 / 13)      Lines: 74.14% (43 / 58)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/
File Statements Branches Functions Lines
Config.js 74.14% (43 / 58) 31.25% (5 / 16) 53.85% (7 / 13) 74.14% (43 / 58)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/Config.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/Config.js

Statements: 74.14% (43 / 58)      Branches: 31.25% (5 / 16)      Functions: 53.85% (7 / 13)      Lines: 74.14% (43 / 58)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 1111 1 1 1 1 1 1   1 1 1 1     1 1   1         1   1   1     1       1                                     1       1 1 1 1 1                   1 1     1 1     1         1 1     1 1           1 1   1 1 1   1   1     1   1    
var lang = require('mout/lang');
var object = require('mout/object');
var rc = require('./util/rc');
var expand = require('./util/expand');
var EnvProxy = require('./util/proxy');
var path = require('path');
var fs = require('fs');
 
function Config(cwd) {
    this._cwd = cwd;
    this._proxy = new EnvProxy();
    this._config = {};
}
 
Config.prototype.load = function (overwrites) {
    this._config = rc('bower', this._cwd);
 
    this._config = object.merge(
      expand(this._config || {}),
      expand(overwrites || {})
    );
 
    this._config = normalise(this._config);
 
    this._proxy.set(this._config);
 
    return this;
};
 
Config.prototype.restore = function () {
  this._proxy.restore();
};
 
function readCertFile(path) {
    path = path || '';
 
    var sep = '-----END CERTIFICATE-----';
 
    var certificates;
 
    if (path.indexOf(sep) === -1) {
        certificates = fs.readFileSync(path, { encoding: 'utf8' });
    } else {
        certificates = path;
    }
 
    return certificates.
      split(sep).
      filter(function(s) { return !s.match(/^\s*$/); }).
      map(function(s) { return s + sep; });
}
 
function loadCAs(caConfig) {
    // If a ca file path has been specified, expand that here to the file's
    // contents. As a user can specify these individually, we must load them
    // one by one.
    for (var p in caConfig) {
        Eif (caConfig.hasOwnProperty(p)) {
            var prop = caConfig[p];
            Eif (Array.isArray(prop)) {
                caConfig[p] = prop.map(function(s) {
                    return readCertFile(s);
                });
            } else if (prop) {
                caConfig[p] = readCertFile(prop);
            }
        }
    }
}
 
Config.prototype.toObject = function () {
    return lang.deepClone(this._config);
};
 
Config.create = function (cwd) {
    return new Config(cwd);
};
 
Config.read = function (cwd, overrides) {
    var config = Config.create(cwd);
    return config.load(overrides).toObject();
};
 
function normalise(config) {
    config = expand(config);
 
    // Some backwards compatible things..
    Eif (config.shorthandResolver) {
      config.shorthandResolver = config.shorthandResolver
        .replace(/\{\{\{/g, '{{')
        .replace(/\}\}\}/g, '}}');
    }
 
    // Ensure that every registry endpoint does not end with /
    config.registry.search = config.registry.search.map(function (url) {
        return url.replace(/\/+$/, '');
    });
    config.registry.register = config.registry.register.replace(/\/+$/, '');
    config.registry.publish = config.registry.publish.replace(/\/+$/, '');
    config.tmp = path.resolve(config.tmp);
 
    loadCAs(config.ca);
 
    return config;
}
 
Config.DEFAULT_REGISTRY = require('./util/defaults').registry;
 
module.exports = Config;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/

Statements: 58.65% (122 / 208)      Branches: 45.58% (67 / 147)      Functions: 66.67% (14 / 21)      Lines: 58.94% (122 / 207)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/
File Statements Branches Functions Lines
defaults.js 100% (8 / 8) 91.67% (11 / 12) 100% (0 / 0) 100% (8 / 8)
expand.js 73.68% (42 / 57) 55.77% (29 / 52) 85.71% (6 / 7) 75% (42 / 56)
paths.js 70.83% (17 / 24) 43.48% (10 / 23) 0% (0 / 1) 70.83% (17 / 24)
proxy.js 21.43% (9 / 42) 12.5% (3 / 24) 66.67% (2 / 3) 21.43% (9 / 42)
rc.js 59.74% (46 / 77) 38.89% (14 / 36) 60% (6 / 10) 59.74% (46 / 77)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/defaults.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/defaults.js

Statements: 100% (8 / 8)      Branches: 91.67% (11 / 12)      Functions: 100% (0 / 0)      Lines: 100% (8 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 471 1     1       1       1         1       1                                             1    
var path = require('path');
var paths = require('./paths');
 
// Guess proxy defined in the env
var proxy = process.env.HTTP_PROXY
    || process.env.http_proxy
    || null;
 
var httpsProxy = process.env.HTTPS_PROXY
    || process.env.https_proxy
    || proxy;
 
var noProxy = process.env.NO_PROXY
    || process.env.no_proxy;
 
// Use a well known user agent (in this case, curl) when using a proxy,
// to avoid potential filtering on many corporate proxies with blank or unknown agents
var userAgent = !proxy && !httpsProxy
    ? 'node/' + process.version + ' ' + process.platform + ' ' + process.arch
    : 'curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5';
 
var defaults = {
    'directory': 'bower_components',
    'registry': 'https://bower.herokuapp.com',
    'shorthand-resolver': 'https://github.com/{{owner}}/{{package}}.git',
    'tmp': paths.tmp,
    'proxy': proxy,
    'https-proxy': httpsProxy,
    'no-proxy': noProxy,
    'timeout': 30000,
    'ca': { search: [] },
    'strict-ssl': true,
    'user-agent': userAgent,
    'color': true,
    'interactive': null,
    'storage': {
        packages: path.join(paths.cache, 'packages'),
        links: path.join(paths.data, 'links'),
        completion: path.join(paths.data, 'completion'),
        registry: path.join(paths.cache, 'registry'),
        empty: path.join(paths.data, 'empty')  // Empty dir, used in GIT_TEMPLATE_DIR among others
    }
};
 
module.exports = defaults;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/expand.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/expand.js

Statements: 73.68% (42 / 57)      Branches: 55.77% (29 / 52)      Functions: 85.71% (6 / 7)      Lines: 75% (42 / 56)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 1281 1 1   1 8     8   42 4     38 38     8           1     24 24     24 24                     1 8   8     38             38           38 5   33 24     9       8     1 3 3   3 1           2 1   1             1           3             3 2       2             3     1    
var object = require('mout/object');
var lang = require('mout/lang');
var string = require('mout/string');
 
function camelCase(config) {
    var camelCased = {};
 
    // Camel case
    object.forOwn(config, function (value, key) {
        // Ignore null values
        if (value == null) {
            return;
        }
 
        key = string.camelCase(key.replace(/_/g, '-'));
        camelCased[key] = lang.isPlainObject(value) ? camelCase(value) : value;
    });
 
    return camelCased;
}
 
// Function to replace ${VAR} - style variables
//  with values set in the environment
// This function expects to be passed a string
function doEnvReplaceStr (f) {
 
  // Un-tildify
  var untildify = require('untildify');
  f = untildify(f);
 
  // replace any ${ENV} values with the appropriate environ.
  var envExpr = /(\\*)\$\{([^}]+)\}/g;
  return f.replace(envExpr, function (orig, esc, name) {
    esc = esc.length && esc.length % 2;
    if (esc) return orig;
    if (undefined === process.env[name]) {
      throw new Error('Environment variable used in .bowerrc is not defined: ' + orig);
    }
 
    return process.env[name];
});
}
 
function envReplace(config) {
    var envReplaced = {};
 
    object.forOwn(config, function (value, key) {
 
        // Ignore null values
        Iif (value == null) {
            return;
        }
 
        // Ignore 'scripts'
        // These hooks run within the shell
        // environment variable expansion is not required
        Iif ( key === 'scripts' && lang.isPlainObject(value) ){
            envReplaced[key] = value;
            return;
        }
 
        // Perform variable replacements based on var type
        if ( lang.isPlainObject(value) ) {
            envReplaced[key] = envReplace(value);
        }
        else if ( lang.isString(value) ) {
            envReplaced[key] = doEnvReplaceStr(value);
        }
        else {
            envReplaced[key] = value;
        }
    });
 
    return envReplaced;
}
 
function expand(config) {
    config = camelCase(config);
    config = envReplace(config);
 
    if (typeof config.registry === 'string') {
        config.registry = {
            default: config.registry,
            search: [config.registry],
            register: config.registry,
            publish: config.registry
        };
    } else if (typeof config.registry === 'object') {
        config.registry.default = config.registry.default || 'https://bower.herokuapp.com';
 
        config.registry = {
            default: config.registry.default,
            search: config.registry.search || config.registry.default,
            register: config.registry.register || config.registry.default,
            publish: config.registry.publish || config.registry.default
        };
 
        Iif (config.registry.search && !Array.isArray(config.registry.search)) {
            config.registry.search = [config.registry.search];
        }
    }
 
    // CA
    Iif (typeof config.ca === 'string') {
        config.ca = {
            default: config.ca,
            search: [config.ca],
            register: config.ca,
            publish: config.ca
        };
    } else if (typeof config.ca === 'object') {
        Iif (config.ca.search && !Array.isArray(config.ca.search)) {
            config.ca.search = [config.ca.search];
        }
 
        Iif (config.ca.default) {
            config.ca.search = config.ca.search || config.ca.default;
            config.ca.register = config.ca.register || config.ca.default;
            config.ca.publish = config.ca.publish || config.ca.default;
        }
    }
 
    return config;
}
 
module.exports = expand;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/paths.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/paths.js

Statements: 70.83% (17 / 24)      Branches: 43.48% (10 / 23)      Functions: 0% (0 / 1)      Lines: 70.83% (17 / 24)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 461 1 1 1   1             1             1 1 1 1     1                 1   1 1 1     1   1    
var os = require('os');
var path = require('path');
var osenv = require('osenv');
var crypto = require('crypto');
 
function generateFakeUser() {
    var uid = process.pid + '-' + Date.now() + '-' + Math.floor(Math.random() * 1000000);
    return crypto.createHash('md5').update(uid).digest('hex');
}
 
// Assume XDG defaults
// See: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
var paths = {
    config: process.env.XDG_CONFIG_HOME,
    data: process.env.XDG_DATA_HOME,
    cache: process.env.XDG_CACHE_HOME
};
 
// Guess some needed properties based on the user OS
var user = (osenv.user() || generateFakeUser()).replace(/\\/g, '-');
var tmp = path.join(os.tmpdir ? os.tmpdir() : os.tmpDir(), user);
var home = osenv.home();
var base;
 
// Fallbacks for windows
Iif (process.platform === 'win32') {
    base = path.resolve(process.env.LOCALAPPDATA || home || tmp);
    base = path.join(base, 'bower');
 
    paths.config = paths.config || path.join(base, 'config');
    paths.data = paths.data || path.join(base, 'data');
    paths.cache = paths.cache || path.join(base, 'cache');
// Fallbacks for other operating systems
} else {
    base = path.resolve(home || tmp);
 
    paths.config = paths.config || path.join(base, '.config/bower');
    paths.data = paths.data || path.join(base, '.local/share/bower');
    paths.cache = paths.cache || path.join(base, '.cache/bower');
}
 
paths.tmp = path.resolve(path.join(tmp, 'bower'));
 
module.exports = paths;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/proxy.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/proxy.js

Statements: 21.43% (9 / 42)      Branches: 12.5% (3 / 24)      Functions: 66.67% (2 / 3)      Lines: 21.43% (9 / 42)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81      1 1     1 1       1             1             1               1                                                                                       1    
// EnvProxy uses the proxy vaiables passed to it in set and sets the
// process.env uppercase proxy variables to them with the ability
// to restore the original values later
var EnvProxy = function() {
  this.restoreFrom = {};
};
 
EnvProxy.prototype.set = function (config) {
  this.config = config;
 
  // Override environment defaults if proxy config options are set
  // This will make requests.js follow the proxies in config
  Iif (Object.prototype.hasOwnProperty.call(config, 'noProxy')) {
    this.restoreFrom.NO_PROXY = process.env.NO_PROXY;
    this.restoreFrom.no_proxy = process.env.no_proxy;
    delete process.env.no_proxy;
    process.env.NO_PROXY = config.noProxy;
  }
 
  Iif (Object.prototype.hasOwnProperty.call(config, 'proxy')) {
    this.restoreFrom.HTTP_PROXY = process.env.HTTP_PROXY;
    this.restoreFrom.http_proxy = process.env.http_proxy;
    delete process.env.http_proxy;
    process.env.HTTP_PROXY = config.proxy;
  }
 
  Iif (Object.prototype.hasOwnProperty.call(config, 'httpsProxy')) {
    this.restoreFrom.HTTPS_PROXY = process.env.HTTPS_PROXY;
    this.restoreFrom.https_proxy = process.env.https_proxy;
    delete process.env.https_proxy;
    process.env.HTTPS_PROXY = config.httpsProxy;
  }
};
 
EnvProxy.prototype.restore = function () {
  if (Object.prototype.hasOwnProperty.call(this.config, 'noProxy')) {
    if (this.restoreFrom.NO_PROXY !== undefined) {
      process.env.NO_PROXY = this.restoreFrom.NO_PROXY;
    } else {
      delete process.env.NO_PROXY;
    }
 
    if (this.restoreFrom.no_proxy !== undefined) {
      process.env.no_proxy = this.restoreFrom.no_proxy;
    } else {
      delete process.env.no_proxy;
    }
  }
 
  if (Object.prototype.hasOwnProperty.call(this.config, 'proxy')) {
    if (this.restoreFrom.HTTP_PROXY !== undefined) {
      process.env.HTTP_PROXY = this.restoreFrom.HTTP_PROXY;
    } else {
      delete process.env.HTTP_PROXY;
    }
 
    if (this.restoreFrom.http_proxy !== undefined) {
      process.env.http_proxy = this.restoreFrom.http_proxy;
    } else {
      delete process.env.http_proxy;
    }
  }
 
  if (Object.prototype.hasOwnProperty.call(this.config, 'httpsProxy')) {
    if (this.restoreFrom.HTTPS_PROXY !== undefined) {
      process.env.HTTPS_PROXY = this.restoreFrom.HTTPS_PROXY;
    } else {
      delete process.env.HTTPS_PROXY;
    }
 
    if (this.restoreFrom.https_proxy !== undefined) {
      process.env.https_proxy = this.restoreFrom.https_proxy;
    } else {
      delete process.env.https_proxy;
    }
  }
};
 
module.exports = EnvProxy;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/rc.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/lib/util/rc.js

Statements: 59.74% (46 / 77)      Branches: 38.89% (14 / 36)      Functions: 60% (6 / 10)      Lines: 59.74% (46 / 77)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 1601 1 1 1 1 1 1 1   1 1   1 1   1     1         1   1 1                                                   1                                           1 4 4 3 3   3           1                       1       1 2 2   2   2 536   536                                           2     1 1   1 6 6   6       6 5       1 1 1     1    
var path = require('path');
var fs = require('graceful-fs');
var optimist = require('optimist');
var osenv = require('osenv');
var object = require('mout/object');
var string = require('mout/string');
var paths = require('./paths');
var defaults = require('./defaults');
 
var win = process.platform === 'win32';
var home = osenv.home();
 
function rc(name, cwd, argv) {
    var argvConfig;
 
    argv = argv || optimist.argv;
 
    // Parse --config.foo=false
    argvConfig = object.map(argv.config || {}, function (value) {
        return value === 'false' ? false : value;
    });
 
    // If we have specified a cwd then use this as the base for getting config.
    cwd = argvConfig.cwd ? argvConfig.cwd : cwd;
 
    Eif (cwd) {
        return object.deepMixIn.apply(null, [
            {},
            defaults,
            { cwd: cwd },
            win ? {} : json(path.join('/etc', name + 'rc')),
            !home ? {} : json(path.join(home, '.' + name + 'rc')),
            json(path.join(paths.config, name + 'rc')),
            json(find('.' + name + 'rc', cwd)),
            env('npm_package_config_' + name + '_'),
            env(name + '_'),
            argvConfig
        ]);
    } else {
        return object.deepMixIn.apply(null, [
            {},
            defaults,
            win ? {} : json(path.join('/etc', name + 'rc')),
            !home ? {} : json(path.join(home, '.' + name + 'rc')),
            json(path.join(paths.config, name + 'rc')),
            env('npm_package_config_' + name + '_'),
            env(name + '_'),
            argvConfig
        ]);
    }
}
 
function parse(content, file) {
    var error;
 
    if (!content.trim().length) {
        return {};
    }
 
    try {
        return JSON.parse(content);
    } catch (e) {
        if (file) {
            error = new Error('Unable to parse ' + file + ': ' + e.message);
        } else {
            error = new Error('Unable to parse rc config: ' + e.message);
        }
 
        error.details = content;
        error.code = 'EMALFORMED';
        throw error;
    }
}
 
function json(file) {
    var content = {};
    if (!Array.isArray(file)) {
        try {
            content = fs.readFileSync(file).toString();
        } catch (err) {
            return null;
        }
 
        return parse(content, file);
    } else {
        // This is multiple json files
        file.forEach(function(filename) {
            if (fs.statSync(filename).isDirectory()) {
                var error;
                error = new Error(filename + ' should not be a directory');
                error.code = 'EFILEISDIR';
                throw error;
            }
            var json = fs.readFileSync(filename).toString();
            json = parse(json, filename);
            content = object.merge(content, json);
        });
 
        return content;
    }
}
 
function env(prefix) {
    var obj = {};
    var prefixLength = prefix.length;
 
    prefix = prefix.toLowerCase();
 
    object.forOwn(process.env, function (value, key) {
        key = key.toLowerCase();
 
        Iif (string.startsWith(key, prefix)) {
            var parsedKey = key
                           .substr(prefixLength)
                           .replace(/__/g, '.')   // __ is used for nesting
                           .replace(/_/g, '-');   // _ is used as a - separator
 
            //use a convention patern to accept array from process.env
            //e.g. export bower_registry__search='["http://abc.com","http://def.com"]'
            var match = /\[([^\]]*)\]/g.exec(value);
            var targetValue;
            if (!match || match.length === 0) {
                targetValue = value;
            } else {
                targetValue = match[1].split(',')
                    .map(function(m) {
                        return m.trim();
                    });
            }
            object.set(obj, parsedKey, targetValue);
        }
    });
 
    return obj;
}
 
function find(filename, dir) {
    var files = [];
 
    var walk = function (filename, dir) {
        var file = path.join(dir, filename);
        var parent = path.dirname(dir);
 
        Iif (fs.existsSync(file)) {
            files.push(file);
        }
 
        if (parent !== dir) {
            walk(filename, parent);
        }
    };
 
    walk(filename, dir);
    files.reverse();
    return files;
}
 
module.exports = rc;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (3 / 3)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/
File Statements Branches Functions Lines
lang.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
object.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
string.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42        1                                                                          
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'GLOBAL' : require('./lang/GLOBAL'),
    'clone' : require('./lang/clone'),
    'createObject' : require('./lang/createObject'),
    'ctorApply' : require('./lang/ctorApply'),
    'deepClone' : require('./lang/deepClone'),
    'deepEquals' : require('./lang/deepEquals'),
    'defaults' : require('./lang/defaults'),
    'inheritPrototype' : require('./lang/inheritPrototype'),
    'is' : require('./lang/is'),
    'isArguments' : require('./lang/isArguments'),
    'isArray' : require('./lang/isArray'),
    'isBoolean' : require('./lang/isBoolean'),
    'isDate' : require('./lang/isDate'),
    'isEmpty' : require('./lang/isEmpty'),
    'isFinite' : require('./lang/isFinite'),
    'isFunction' : require('./lang/isFunction'),
    'isInteger' : require('./lang/isInteger'),
    'isKind' : require('./lang/isKind'),
    'isNaN' : require('./lang/isNaN'),
    'isNull' : require('./lang/isNull'),
    'isNumber' : require('./lang/isNumber'),
    'isObject' : require('./lang/isObject'),
    'isPlainObject' : require('./lang/isPlainObject'),
    'isPrimitive' : require('./lang/isPrimitive'),
    'isRegExp' : require('./lang/isRegExp'),
    'isString' : require('./lang/isString'),
    'isUndefined' : require('./lang/isUndefined'),
    'isnt' : require('./lang/isnt'),
    'kindOf' : require('./lang/kindOf'),
    'toArray' : require('./lang/toArray'),
    'toNumber' : require('./lang/toNumber'),
    'toString' : require('./lang/toString')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46        1                                                                                  
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'bindAll' : require('./object/bindAll'),
    'contains' : require('./object/contains'),
    'deepFillIn' : require('./object/deepFillIn'),
    'deepMatches' : require('./object/deepMatches'),
    'deepMixIn' : require('./object/deepMixIn'),
    'equals' : require('./object/equals'),
    'every' : require('./object/every'),
    'fillIn' : require('./object/fillIn'),
    'filter' : require('./object/filter'),
    'find' : require('./object/find'),
    'flatten' : require('./object/flatten'),
    'forIn' : require('./object/forIn'),
    'forOwn' : require('./object/forOwn'),
    'functions' : require('./object/functions'),
    'get' : require('./object/get'),
    'has' : require('./object/has'),
    'hasOwn' : require('./object/hasOwn'),
    'keys' : require('./object/keys'),
    'map' : require('./object/map'),
    'matches' : require('./object/matches'),
    'max' : require('./object/max'),
    'merge' : require('./object/merge'),
    'min' : require('./object/min'),
    'mixIn' : require('./object/mixIn'),
    'namespace' : require('./object/namespace'),
    'omit' : require('./object/omit'),
    'pick' : require('./object/pick'),
    'pluck' : require('./object/pluck'),
    'reduce' : require('./object/reduce'),
    'reject' : require('./object/reject'),
    'result' : require('./object/result'),
    'set' : require('./object/set'),
    'size' : require('./object/size'),
    'some' : require('./object/some'),
    'unset' : require('./object/unset'),
    'values' : require('./object/values')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48        1                                                                                      
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'WHITE_SPACES' : require('./string/WHITE_SPACES'),
    'camelCase' : require('./string/camelCase'),
    'contains' : require('./string/contains'),
    'crop' : require('./string/crop'),
    'endsWith' : require('./string/endsWith'),
    'escapeHtml' : require('./string/escapeHtml'),
    'escapeRegExp' : require('./string/escapeRegExp'),
    'escapeUnicode' : require('./string/escapeUnicode'),
    'hyphenate' : require('./string/hyphenate'),
    'insert' : require('./string/insert'),
    'interpolate' : require('./string/interpolate'),
    'lowerCase' : require('./string/lowerCase'),
    'lpad' : require('./string/lpad'),
    'ltrim' : require('./string/ltrim'),
    'makePath' : require('./string/makePath'),
    'normalizeLineBreaks' : require('./string/normalizeLineBreaks'),
    'pascalCase' : require('./string/pascalCase'),
    'properCase' : require('./string/properCase'),
    'removeNonASCII' : require('./string/removeNonASCII'),
    'removeNonWord' : require('./string/removeNonWord'),
    'repeat' : require('./string/repeat'),
    'replace' : require('./string/replace'),
    'replaceAccents' : require('./string/replaceAccents'),
    'rpad' : require('./string/rpad'),
    'rtrim' : require('./string/rtrim'),
    'sentenceCase' : require('./string/sentenceCase'),
    'slugify' : require('./string/slugify'),
    'startsWith' : require('./string/startsWith'),
    'stripHtmlTags' : require('./string/stripHtmlTags'),
    'trim' : require('./string/trim'),
    'truncate' : require('./string/truncate'),
    'typecast' : require('./string/typecast'),
    'unCamelCase' : require('./string/unCamelCase'),
    'underscore' : require('./string/underscore'),
    'unescapeHtml' : require('./string/unescapeHtml'),
    'unescapeUnicode' : require('./string/unescapeUnicode'),
    'unhyphenate' : require('./string/unhyphenate'),
    'upperCase' : require('./string/upperCase')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/

Statements: 27.01% (37 / 137)      Branches: 0% (0 / 68)      Functions: 0% (0 / 15)      Lines: 27.01% (37 / 137)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/
File Statements Branches Functions Lines
contains.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
equals.js 42.86% (6 / 14) 0% (0 / 10) 0% (0 / 3) 42.86% (6 / 14)
every.js 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
filter.js 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
find.js 60% (3 / 5) 0% (0 / 2) 0% (0 / 1) 60% (3 / 5)
findIndex.js 27.27% (3 / 11) 0% (0 / 4) 0% (0 / 1) 27.27% (3 / 11)
forEach.js 25% (2 / 8) 0% (0 / 4) 0% (0 / 1) 25% (2 / 8)
indexOf.js 18.18% (2 / 11) 0% (0 / 8) 0% (0 / 1) 18.18% (2 / 11)
join.js 57.14% (4 / 7) 0% (0 / 4) 0% (0 / 2) 57.14% (4 / 7)
max.js 17.65% (3 / 17) 0% (0 / 10) 0% (0 / 1) 17.65% (3 / 17)
min.js 17.65% (3 / 17) 0% (0 / 10) 0% (0 / 1) 17.65% (3 / 17)
slice.js 11.76% (2 / 17) 0% (0 / 8) 0% (0 / 1) 11.76% (2 / 17)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/contains.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/contains.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121         1     1      
var indexOf = require('./indexOf');
 
    /**
     * If array contains values.
     */
    function contains(arr, val) {
        return indexOf(arr, val) !== -1;
    }
    module.exports = contains;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/equals.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/equals.js

Statements: 42.86% (6 / 14)      Branches: 0% (0 / 10)      Functions: 0% (0 / 3)      Lines: 42.86% (6 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1 1         1                           1           1        
var is = require('../lang/is');
var isArray = require('../lang/isArray');
var every = require('./every');
 
    /**
     * Compares if both arrays have the same elements
     */
    function equals(a, b, callback){
        callback = callback || is;
 
        if (!isArray(a) || !isArray(b)) {
            return callback(a, b);
        }
 
        if (a.length !== b.length) {
            return false;
        }
 
        return every(a, makeCompare(callback), b);
    }
 
    function makeCompare(callback) {
        return function(value, i) {
            return i in this && callback(value, this[i]);
        };
    }
 
    module.exports = equals;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/every.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/every.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291         1                                       1      
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Array every
     */
    function every(arr, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var result = true;
        if (arr == null) {
            return result;
        }
 
        var i = -1, len = arr.length;
        while (++i < len) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            if (!callback(arr[i], i, arr) ) {
                result = false;
                break;
            }
        }
 
        return result;
    }
 
    module.exports = every;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/filter.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/filter.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 281         1                                   1        
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Array filter
     */
    function filter(arr, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var results = [];
        if (arr == null) {
            return results;
        }
 
        var i = -1, len = arr.length, value;
        while (++i < len) {
            value = arr[i];
            if (callback(value, i, arr)) {
                results.push(value);
            }
        }
 
        return results;
    }
 
    module.exports = filter;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/find.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/find.js

Statements: 60% (3 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151         1         1        
var findIndex = require('./findIndex');
 
    /**
     * Returns first item that matches criteria
     */
    function find(arr, iterator, thisObj){
        var idx = findIndex(arr, iterator, thisObj);
        return idx >= 0? arr[idx] : void(0);
    }
 
    module.exports = find;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/findIndex.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/findIndex.js

Statements: 27.27% (3 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251         1                               1      
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Returns the index of the first item that matches criteria
     */
    function findIndex(arr, iterator, thisObj){
        iterator = makeIterator(iterator, thisObj);
        if (arr == null) {
            return -1;
        }
 
        var i = -1, len = arr.length;
        while (++i < len) {
            if (iterator(arr[i], i, arr)) {
                return i;
            }
        }
 
        return -1;
    }
 
    module.exports = findIndex;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/forEach.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/forEach.js

Statements: 25% (2 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25          1                             1        
 
 
    /**
     * Array forEach
     */
    function forEach(arr, callback, thisObj) {
        if (arr == null) {
            return;
        }
        var i = -1,
            len = arr.length;
        while (++i < len) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            if ( callback.call(thisObj, arr[i], i, arr) === false ) {
                break;
            }
        }
    }
 
    module.exports = forEach;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/indexOf.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/indexOf.js

Statements: 18.18% (2 / 11)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30          1                                         1      
 
 
    /**
     * Array.indexOf
     */
    function indexOf(arr, item, fromIndex) {
        fromIndex = fromIndex || 0;
        if (arr == null) {
            return -1;
        }
 
        var len = arr.length,
            i = fromIndex < 0 ? len + fromIndex : fromIndex;
        while (i < len) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            if (arr[i] === item) {
                return i;
            }
 
            i++;
        }
 
        return -1;
    }
 
    module.exports = indexOf;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/join.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/join.js

Statements: 57.14% (4 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191   1               1         1      
var filter = require('./filter');
 
    function isValidString(val) {
        return (val != null && val !== '');
    }
 
    /**
     * Joins strings with the specified separator inserted between each value.
     * Null values and empty strings will be excluded.
     */
    function join(items, separator) {
        separator = separator || '';
        return filter(items, isValidString).join(separator);
    }
 
    module.exports = join;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/max.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/max.js

Statements: 17.65% (3 / 17)      Branches: 0% (0 / 10)      Functions: 0% (0 / 1)      Lines: 17.65% (3 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361         1                                                   1        
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Return maximum value inside array
     */
    function max(arr, iterator, thisObj){
        if (arr == null || !arr.length) {
            return Infinity;
        } else if (arr.length && !iterator) {
            return Math.max.apply(Math, arr);
        } else {
            iterator = makeIterator(iterator, thisObj);
            var result,
                compare = -Infinity,
                value,
                temp;
 
            var i = -1, len = arr.length;
            while (++i < len) {
                value = arr[i];
                temp = iterator(value, i, arr);
                if (temp > compare) {
                    compare = temp;
                    result = value;
                }
            }
 
            return result;
        }
    }
 
    module.exports = max;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/min.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/min.js

Statements: 17.65% (3 / 17)      Branches: 0% (0 / 10)      Functions: 0% (0 / 1)      Lines: 17.65% (3 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361         1                                                   1        
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Return minimum value inside array
     */
    function min(arr, iterator, thisObj){
        if (arr == null || !arr.length) {
            return -Infinity;
        } else if (arr.length && !iterator) {
            return Math.min.apply(Math, arr);
        } else {
            iterator = makeIterator(iterator, thisObj);
            var result,
                compare = Infinity,
                value,
                temp;
 
            var i = -1, len = arr.length;
            while (++i < len) {
                value = arr[i];
                temp = iterator(value, i, arr);
                if (temp < compare) {
                    compare = temp;
                    result = value;
                }
            }
 
            return result;
        }
    }
 
    module.exports = min;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/slice.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/slice.js

Statements: 11.76% (2 / 17)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 11.76% (2 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37          1                                                     1        
 
 
    /**
     * Create slice of source array or array-like object
     */
    function slice(arr, start, end){
        var len = arr.length;
 
        if (start == null) {
            start = 0;
        } else if (start < 0) {
            start = Math.max(len + start, 0);
        } else {
            start = Math.min(start, len);
        }
 
        if (end == null) {
            end = len;
        } else if (end < 0) {
            end = Math.max(len + end, 0);
        } else {
            end = Math.min(end, len);
        }
 
        var result = [];
        while (start < end) {
            result.push(arr[start++]);
        }
 
        return result;
    }
 
    module.exports = slice;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/

Statements: 57.69% (15 / 26)      Branches: 37.5% (3 / 8)      Functions: 12.5% (1 / 8)      Lines: 57.69% (15 / 26)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/
File Statements Branches Functions Lines
bind.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 2) 50% (3 / 6)
identity.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
makeIterator_.js 61.54% (8 / 13) 37.5% (3 / 8) 33.33% (1 / 3) 61.54% (8 / 13)
prop.js 50% (2 / 4) 100% (0 / 0) 0% (0 / 2) 50% (2 / 4)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/bind.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/bind.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211                 1             1        
var slice = require('../array/slice');
 
    /**
     * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection.
     * @param {Function} fn  Function.
     * @param {object} context   Execution context.
     * @param {rest} args    Arguments (0...n arguments).
     * @return {Function} Wrapped Function.
     */
    function bind(fn, context, args){
        var argsArr = slice(arguments, 2); //curried args
        return function(){
            return fn.apply(context, argsArr.concat(slice(arguments)));
        };
    }
 
    module.exports = bind;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/identity.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/identity.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14          1       1        
 
 
    /**
     * Returns the first argument provided to it.
     */
    function identity(val){
        return val;
    }
 
    module.exports = identity;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/makeIterator_.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/makeIterator_.js

Statements: 61.54% (8 / 13)      Branches: 37.5% (3 / 8)      Functions: 33.33% (1 / 3)      Lines: 61.54% (8 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361 1 1             1 1     1         1                         1        
var identity = require('./identity');
var prop = require('./prop');
var deepMatches = require('../object/deepMatches');
 
    /**
     * Converts argument into a valid iterator.
     * Used internally on most array/object/collection methods that receives a
     * callback/iterator providing a shortcut syntax.
     */
    function makeIterator(src, thisObj){
        Iif (src == null) {
            return identity;
        }
        switch(typeof src) {
            case 'function':
                // function is the first to improve perf (most common case)
                // also avoid using `Function#call` if not needed, which boosts
                // perf a lot in some cases
                return (typeof thisObj !== 'undefined')? function(val, i, arr){
                    return src.call(thisObj, val, i, arr);
                } : src;
            case 'object':
                return function(val){
                    return deepMatches(val, src);
                };
            case 'string':
            case 'number':
                return prop(src);
        }
    }
 
    module.exports = makeIterator;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/prop.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/function/prop.js

Statements: 50% (2 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16          1           1        
 
 
    /**
     * Returns a function that gets a property of the passed object
     */
    function prop(name){
        return function(obj){
            return obj[name];
        };
    }
 
    module.exports = prop;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/

Statements: 58.77% (134 / 228)      Branches: 14.13% (13 / 92)      Functions: 22.73% (10 / 44)      Lines: 59.82% (134 / 224)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/
File Statements Branches Functions Lines
GLOBAL.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
clone.js 44% (11 / 25) 7.69% (1 / 13) 20% (1 / 5) 44% (11 / 25)
createObject.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 2) 66.67% (4 / 6)
ctorApply.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
deepClone.js 87.5% (21 / 24) 57.14% (4 / 7) 100% (4 / 4) 87.5% (21 / 24)
deepEquals.js 50% (8 / 16) 0% (0 / 13) 0% (0 / 2) 50% (8 / 16)
defaults.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 2) 71.43% (5 / 7)
inheritPrototype.js 37.5% (3 / 8) 100% (0 / 0) 0% (0 / 1) 37.5% (3 / 8)
is.js 40% (2 / 5) 0% (0 / 6) 0% (0 / 1) 40% (2 / 5)
isArguments.js 60% (3 / 5) 25% (1 / 4) 0% (0 / 2) 60% (3 / 5)
isArray.js 75% (3 / 4) 50% (1 / 2) 0% (0 / 1) 75% (3 / 4)
isBoolean.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isDate.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isEmpty.js 26.67% (4 / 15) 0% (0 / 8) 0% (0 / 2) 26.67% (4 / 15)
isFinite.js 40% (4 / 10) 0% (0 / 6) 0% (0 / 1) 40% (4 / 10)
isFunction.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isInteger.js 75% (3 / 4) 0% (0 / 2) 0% (0 / 1) 75% (3 / 4)
isKind.js 100% (4 / 4) 100% (0 / 0) 100% (1 / 1) 100% (4 / 4)
isNaN.js 80% (4 / 5) 0% (0 / 2) 0% (0 / 1) 80% (4 / 5)
isNull.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
isNumber.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isObject.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isPlainObject.js 100% (3 / 3) 100% (3 / 3) 100% (1 / 1) 100% (3 / 3)
isPrimitive.js 40% (2 / 5) 0% (0 / 3) 0% (0 / 1) 40% (2 / 5)
isRegExp.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isString.js 100% (4 / 4) 100% (0 / 0) 100% (1 / 1) 100% (4 / 4)
isUndefined.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isnt.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
kindOf.js 75% (6 / 8) 50% (2 / 4) 100% (1 / 1) 75% (6 / 8)
toArray.js 33.33% (4 / 12) 0% (0 / 9) 0% (0 / 1) 33.33% (4 / 12)
toNumber.js 25% (3 / 12) 0% (0 / 8) 0% (0 / 1) 37.5% (3 / 8)
toString.js 100% (3 / 3) 50% (1 / 2) 100% (1 / 1) 100% (3 / 3)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/GLOBAL.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/GLOBAL.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9        1        
 
 
    // Reference to the global context (works on ES3 and ES5-strict mode)
    //jshint -W061, -W064
    module.exports = Function('return this')();
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/clone.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/clone.js

Statements: 44% (11 / 25)      Branches: 7.69% (1 / 13)      Functions: 20% (1 / 5)      Lines: 44% (11 / 25)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 511 1 1         1 34                   34       1               1               1       1       1        
var kindOf = require('./kindOf');
var isPlainObject = require('./isPlainObject');
var mixIn = require('../object/mixIn');
 
    /**
     * Clone native types.
     */
    function clone(val){
        switch (kindOf(val)) {
            case 'Object':
                return cloneObject(val);
            case 'Array':
                return cloneArray(val);
            case 'RegExp':
                return cloneRegExp(val);
            case 'Date':
                return cloneDate(val);
            default:
                return val;
        }
    }
 
    function cloneObject(source) {
        if (isPlainObject(source)) {
            return mixIn({}, source);
        } else {
            return source;
        }
    }
 
    function cloneRegExp(r) {
        var flags = '';
        flags += r.multiline ? 'm' : '';
        flags += r.global ? 'g' : '';
        flags += r.ignoreCase ? 'i' : '';
        return new RegExp(r.source, flags);
    }
 
    function cloneDate(date) {
        return new Date(+date);
    }
 
    function cloneArray(arr) {
        return arr.slice();
    }
 
    module.exports = clone;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/createObject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/createObject.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201                 1 1         1        
var mixIn = require('../object/mixIn');
 
    /**
     * Create Object using prototypal inheritance and setting custom properties.
     * - Mix between Douglas Crockford Prototypal Inheritance <http://javascript.crockford.com/prototypal.html> and the EcmaScript 5 `Object.create()` method.
     * @param {object} parent    Parent Object.
     * @param {object} [props] Object properties.
     * @return {object} Created object.
     */
    function createObject(parent, props){
        function F(){}
        F.prototype = parent;
        return mixIn(new F(), props);
 
    }
    module.exports = createObject;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/ctorApply.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/ctorApply.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19    1         1             1        
 
 
    function F(){}
 
    /**
     * Do fn.apply on a constructor.
     */
    function ctorApply(ctor, args) {
        F.prototype = ctor.prototype;
        var instance = new F();
        ctor.apply(instance, args);
        return instance;
    }
 
    module.exports = ctorApply;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/deepClone.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/deepClone.js

Statements: 87.5% (21 / 24)      Branches: 57.14% (4 / 7)      Functions: 100% (4 / 4)      Lines: 87.5% (21 / 24)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 501 1 1 1         1 46   8   4   34       1 8 8 8 42   8               1 4       4 2   4     1          
var clone = require('./clone');
var forOwn = require('../object/forOwn');
var kindOf = require('./kindOf');
var isPlainObject = require('./isPlainObject');
 
    /**
     * Recursively clone native types.
     */
    function deepClone(val, instanceClone) {
        switch ( kindOf(val) ) {
            case 'Object':
                return cloneObject(val, instanceClone);
            case 'Array':
                return cloneArray(val, instanceClone);
            default:
                return clone(val);
        }
    }
 
    function cloneObject(source, instanceClone) {
        Eif (isPlainObject(source)) {
            var out = {};
            forOwn(source, function(val, key) {
                this[key] = deepClone(val, instanceClone);
            }, out);
            return out;
        } else if (instanceClone) {
            return instanceClone(source);
        } else {
            return source;
        }
    }
 
    function cloneArray(arr, instanceClone) {
        var out = [],
            i = -1,
            n = arr.length,
            val;
        while (++i < n) {
            out[i] = deepClone(arr[i], instanceClone);
        }
        return out;
    }
 
    module.exports = deepClone;
 
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/deepEquals.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/deepEquals.js

Statements: 50% (8 / 16)      Branches: 0% (0 / 13)      Functions: 0% (0 / 2)      Lines: 50% (8 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1 1 1 1         1                   1               1        
var is = require('./is');
var isObject = require('./isObject');
var isArray = require('./isArray');
var objEquals = require('../object/equals');
var arrEquals = require('../array/equals');
 
    /**
     * Recursively checks for same properties and values.
     */
    function deepEquals(a, b, callback){
        callback = callback || is;
 
        var bothObjects = isObject(a) && isObject(b);
        var bothArrays = !bothObjects && isArray(a) && isArray(b);
 
        if (!bothObjects && !bothArrays) {
            return callback(a, b);
        }
 
        function compare(a, b){
            return deepEquals(a, b, callback);
        }
 
        var method = bothObjects ? objEquals : arrEquals;
        return method(a, b, compare);
    }
 
    module.exports = deepEquals;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/defaults.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/defaults.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191 1         1       1       1        
var toArray = require('./toArray');
var find = require('../array/find');
 
    /**
     * Return first non void argument
     */
    function defaults(var_args){
        return find(toArray(arguments), nonVoid);
    }
 
    function nonVoid(val){
        return val != null;
    }
 
    module.exports = defaults;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js

Statements: 37.5% (3 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201               1               1      
var createObject = require('./createObject');
 
    /**
    * Inherit prototype from another Object.
    * - inspired by Nicholas Zackas <http://nczonline.net> Solution
    * @param {object} child Child object
    * @param {object} parent    Parent Object
    */
    function inheritPrototype(child, parent){
        var p = createObject(parent.prototype);
        p.constructor = child;
        child.prototype = p;
        child.super_ = parent;
        return p;
    }
 
    module.exports = inheritPrototype;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/is.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/is.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25          1                             1        
 
 
    /**
     * Check if both arguments are egal.
     */
    function is(x, y){
        // implementation borrowed from harmony:egal spec
        if (x === y) {
          // 0 === -0, but they are not identical
          return x !== 0 || 1 / x === 1 / y;
        }
 
        // NaN !== NaN, but they are identical.
        // NaNs are the only non-reflexive value, i.e., if x !== x,
        // then x is a NaN.
        // isNaN is broken: it converts its argument to number, so
        // isNaN("foo") => true
        return x !== x && y !== y;
    }
 
    module.exports = is;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isArguments.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isArguments.js

Statements: 60% (3 / 5)      Branches: 25% (1 / 4)      Functions: 0% (0 / 2)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171       1                 1      
var isKind = require('./isKind');
 
    /**
     */
    var isArgs = isKind(arguments, 'Arguments')?
            function(val){
                return isKind(val, 'Arguments');
            } :
            function(val){
                // Arguments is an Object on IE7
                return !!(val && Object.prototype.hasOwnProperty.call(val, 'callee'));
            };
 
    module.exports = isArgs;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isArray.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isArray.js

Statements: 75% (3 / 4)      Branches: 50% (1 / 2)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    var isArray = Array.isArray || function (val) {
        return isKind(val, 'Array');
    };
    module.exports = isArray;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isBoolean.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isBoolean.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isBoolean(val) {
        return isKind(val, 'Boolean');
    }
    module.exports = isBoolean;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isDate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isDate.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isDate(val) {
        return isKind(val, 'Date');
    }
    module.exports = isDate;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isEmpty.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isEmpty.js

Statements: 26.67% (4 / 15)      Branches: 0% (0 / 8)      Functions: 0% (0 / 2)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1   1                                   1        
var forOwn = require('../object/forOwn');
var isArray = require('./isArray');
 
    function isEmpty(val){
        if (val == null) {
            // typeof null == 'object' so we check it first
            return true;
        } else if ( typeof val === 'string' || isArray(val) ) {
            return !val.length;
        } else if ( typeof val === 'object' ) {
            var result = true;
            forOwn(val, function(){
                result = false;
                return false; // break loop
            });
            return result;
        } else {
            return true;
        }
    }
 
    module.exports = isEmpty;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isFinite.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isFinite.js

Statements: 40% (4 / 10)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 40% (4 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1         1                     1        
var isNumber = require('./isNumber');
var GLOBAL = require('./GLOBAL');
 
    /**
     * Check if value is finite
     */
    function isFinite(val){
        var is = false;
        if (typeof val === 'string' && val !== '') {
            is = GLOBAL.isFinite( parseFloat(val) );
        } else if (isNumber(val)){
            // need to use isNumber because of Number constructor
            is = GLOBAL.isFinite( val );
        }
        return is;
    }
 
    module.exports = isFinite;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isFunction.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isFunction.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isFunction(val) {
        return isKind(val, 'Function');
    }
    module.exports = isFunction;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isInteger.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isInteger.js

Statements: 75% (3 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1       1        
var isNumber = require('./isNumber');
 
    /**
     * Check if value is an integer
     */
    function isInteger(val){
        return isNumber(val) && (val % 1 === 0);
    }
 
    module.exports = isInteger;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isKind.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isKind.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111       1 34   1      
var kindOf = require('./kindOf');
    /**
     * Check if value is from a specific "kind".
     */
    function isKind(val, kind){
        return kindOf(val) === kind;
    }
    module.exports = isKind;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isNaN.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isNaN.js

Statements: 80% (4 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1         1             1        
var isNumber = require('./isNumber');
var $isNaN = require('../number/isNaN');
 
    /**
     * Check if value is NaN for realz
     */
    function isNaN(val){
        // based on the fact that NaN !== NaN
        // need to check if it's a number to avoid conflicts with host objects
        // also need to coerce ToNumber to avoid edge case `new Number(NaN)`
        return !isNumber(val) || $isNaN(Number(val));
    }
 
    module.exports = isNaN;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isNull.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isNull.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11      1     1        
 
    /**
     */
    function isNull(val){
        return val === null;
    }
    module.exports = isNull;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isNumber.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isNumber.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isNumber(val) {
        return isKind(val, 'Number');
    }
    module.exports = isNumber;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isObject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isObject.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isObject(val) {
        return isKind(val, 'Object');
    }
    module.exports = isObject;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js

Statements: 100% (3 / 3)      Branches: 100% (3 / 3)      Functions: 100% (1 / 1)      Lines: 100% (3 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15          1 101       1        
 
 
    /**
     * Checks if the value is created by the `Object` constructor.
     */
    function isPlainObject(value) {
        return (!!value && typeof value === 'object' &&
            value.constructor === Object);
    }
 
    module.exports = isPlainObject;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isPrimitive.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isPrimitive.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 3)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23          1                         1        
 
 
    /**
     * Checks if the object is a primitive
     */
    function isPrimitive(value) {
        // Using switch fallthrough because it's simple to read and is
        // generally fast: http://jsperf.com/testing-value-is-primitive/5
        switch (typeof value) {
            case "string":
            case "number":
            case "boolean":
                return true;
        }
 
        return value == null;
    }
 
    module.exports = isPrimitive;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isRegExp.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isRegExp.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isRegExp(val) {
        return isKind(val, 'RegExp');
    }
    module.exports = isRegExp;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isString.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isString.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1 33   1      
var isKind = require('./isKind');
    /**
     */
    function isString(val) {
        return isKind(val, 'String');
    }
    module.exports = isString;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isUndefined.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isUndefined.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12  1       1     1      
 
    var UNDEF;
 
    /**
     */
    function isUndef(val){
        return val === UNDEF;
    }
    module.exports = isUndef;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isnt.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/isnt.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1       1        
var is = require('./is');
 
    /**
     * Check if both values are not identical/egal
     */
    function isnt(x, y){
        return !is(x, y);
    }
 
    module.exports = isnt;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/kindOf.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/kindOf.js

Statements: 75% (6 / 8)      Branches: 50% (2 / 4)      Functions: 100% (1 / 1)      Lines: 75% (6 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22    1             1 114   114     114     1      
 
 
    var _rKind = /^\[object (.*)\]$/,
        _toString = Object.prototype.toString,
        UNDEF;
 
    /**
     * Gets the "kind" of value. (e.g. "String", "Number", etc)
     */
    function kindOf(val) {
        Iif (val === null) {
            return 'Null';
        } else Iif (val === UNDEF) {
            return 'Undefined';
        } else {
            return _rKind.exec( _toString.call(val) )[1];
        }
    }
    module.exports = kindOf;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/toArray.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/toArray.js

Statements: 33.33% (4 / 12)      Branches: 0% (0 / 9)      Functions: 0% (0 / 1)      Lines: 33.33% (4 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1         1                                           1      
var kindOf = require('./kindOf');
var GLOBAL = require('./GLOBAL');
 
    /**
     * Convert array-like object into array
     */
    function toArray(val){
        var ret = [],
            kind = kindOf(val),
            n;
 
        if (val != null) {
            if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === GLOBAL ) {
                //string, regexp, function have .length but user probably just want
                //to wrap value into an array..
                ret[ret.length] = val;
            } else {
                //window returns true on isObject in IE7 and may have length
                //property. `typeof NodeList` returns `function` on Safari so
                //we can't use it (#58)
                n = val.length;
                while (n--) {
                    ret[n] = val[n];
                }
            }
        }
        return ret;
    }
    module.exports = toArray;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/toNumber.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/toNumber.js

Statements: 25% (3 / 12)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221         1                       1        
var isArray = require('./isArray');
 
    /**
     * covert value into number if numeric
     */
    function toNumber(val){
        // numberic values should come first because of -0
        if (typeof val === 'number') return val;
        // we want all falsy values (besides -0) to return zero to avoid
        // headaches
        if (!val) return 0;
        if (typeof val === 'string') return parseFloat(val);
        // arrays are edge cases. `Number([4]) === 4`
        if (isArray(val)) return NaN;
        return Number(val);
    }
 
    module.exports = toNumber;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/toString.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/lang/toString.js

Statements: 100% (3 / 3)      Branches: 50% (1 / 2)      Functions: 100% (1 / 1)      Lines: 100% (3 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15            1 1189     1        
 
 
    /**
     * Typecast a value to a String, using an empty string value for null or
     * undefined.
     */
    function toString(val){
        return val == null ? '' : val.toString();
    }
 
    module.exports = toString;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/math/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/math/

Statements: 66.67% (2 / 3)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/math/
File Statements Branches Functions Lines
clamp.js 66.67% (2 / 3) 0% (0 / 4) 0% (0 / 1) 66.67% (2 / 3)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/math/clamp.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/math/clamp.js

Statements: 66.67% (2 / 3)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11        1     1      
 
    /**
     * Clamps value inside range.
     */
    function clamp(val, min, max){
        return val < min? min : (val > max? max : val);
    }
    module.exports = clamp;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/number/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/number/

Statements: 66.67% (4 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 66.67% (4 / 6)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/number/
File Statements Branches Functions Lines
isNaN.js 66.67% (2 / 3) 0% (0 / 2) 0% (0 / 1) 66.67% (2 / 3)
toInt.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/number/isNaN.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/number/isNaN.js

Statements: 66.67% (2 / 3)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16            1         1        
 
 
    /**
     * ES6 Number.isNaN
     * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
     */
    function isNaN(val){
        // jshint eqeqeq:false
        return typeof val === 'number' && val != val;
    }
 
    module.exports = isNaN;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/number/toInt.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/number/toInt.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                1           1        
 
 
    /**
     * "Convert" value into an 32-bit integer.
     * Works like `Math.floor` if val > 0 and `Math.ceil` if val < 0.
     * IMPORTANT: val will wrap at 2^31 and -2^31.
     * Perf tests: http://jsperf.com/vs-vs-parseint-bitwise-operators/7
     */
    function toInt(val){
        // we do not use lang/toNumber because of perf and also because it
        // doesn't break the functionality
        return ~~val;
    }
 
    module.exports = toInt;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/

Statements: 49.72% (178 / 358)      Branches: 9.02% (11 / 122)      Functions: 14.71% (10 / 68)      Lines: 49.86% (177 / 355)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/
File Statements Branches Functions Lines
bindAll.js 66.67% (6 / 9) 0% (0 / 2) 0% (0 / 2) 66.67% (6 / 9)
contains.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 2) 60% (3 / 5)
deepFillIn.js 26.67% (4 / 15) 0% (0 / 8) 0% (0 / 2) 26.67% (4 / 15)
deepMatches.js 25.93% (7 / 27) 0% (0 / 16) 0% (0 / 5) 25.93% (7 / 27)
deepMixIn.js 93.33% (14 / 15) 83.33% (5 / 6) 100% (2 / 2) 93.33% (14 / 15)
equals.js 53.33% (8 / 15) 0% (0 / 10) 0% (0 / 4) 53.33% (8 / 15)
every.js 36.36% (4 / 11) 0% (0 / 2) 0% (0 / 2) 36.36% (4 / 11)
fillIn.js 50% (5 / 10) 0% (0 / 2) 0% (0 / 3) 50% (5 / 10)
filter.js 40% (4 / 10) 0% (0 / 2) 0% (0 / 2) 40% (4 / 10)
find.js 36.36% (4 / 11) 0% (0 / 2) 0% (0 / 2) 36.36% (4 / 11)
flatten.js 33.33% (5 / 15) 0% (0 / 10) 0% (0 / 3) 33.33% (5 / 15)
forIn.js 73.91% (17 / 23) 25% (4 / 16) 100% (3 / 3) 72.73% (16 / 22)
forOwn.js 100% (7 / 7) 50% (1 / 2) 100% (2 / 2) 100% (7 / 7)
functions.js 37.5% (3 / 8) 0% (0 / 2) 0% (0 / 2) 37.5% (3 / 8)
get.js 33.33% (3 / 9) 0% (0 / 2) 0% (0 / 1) 37.5% (3 / 8)
has.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
hasOwn.js 100% (3 / 3) 100% (0 / 0) 100% (1 / 1) 100% (3 / 3)
keys.js 42.86% (3 / 7) 50% (1 / 2) 0% (0 / 2) 42.86% (3 / 7)
map.js 88.89% (8 / 9) 100% (0 / 0) 50% (1 / 2) 88.89% (8 / 9)
matches.js 37.5% (3 / 8) 0% (0 / 2) 0% (0 / 2) 37.5% (3 / 8)
max.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
merge.js 62.5% (10 / 16) 0% (0 / 6) 100% (1 / 1) 62.5% (10 / 16)
min.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
mixIn.js 36.36% (4 / 11) 0% (0 / 2) 0% (0 / 2) 36.36% (4 / 11)
namespace.js 30% (3 / 10) 0% (0 / 4) 0% (0 / 2) 33.33% (3 / 9)
omit.js 44.44% (4 / 9) 0% (0 / 6) 0% (0 / 1) 44.44% (4 / 9)
pick.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 1) 42.86% (3 / 7)
pluck.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
reduce.js 30.77% (4 / 13) 0% (0 / 6) 0% (0 / 2) 30.77% (4 / 13)
reject.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 2) 57.14% (4 / 7)
result.js 42.86% (3 / 7) 0% (0 / 4) 0% (0 / 1) 42.86% (3 / 7)
set.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 1) 42.86% (3 / 7)
size.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
some.js 36.36% (4 / 11) 0% (0 / 2) 0% (0 / 2) 36.36% (4 / 11)
unset.js 33.33% (3 / 9) 0% (0 / 2) 0% (0 / 1) 33.33% (3 / 9)
values.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/bindAll.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/bindAll.js

Statements: 66.67% (6 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 66.67% (6 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1 1 1         1               1        
var functions = require('./functions');
var bind = require('../function/bind');
var forEach = require('../array/forEach');
var slice = require('../array/slice');
 
    /**
     * Binds methods of the object to be run in it's own context.
     */
    function bindAll(obj, rest_methodNames){
        var keys = arguments.length > 1?
                    slice(arguments, 1) : functions(obj);
        forEach(keys, function(key){
            obj[key] = bind(obj[key], obj);
        });
    }
 
    module.exports = bindAll;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/contains.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/contains.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151         1         1        
var some = require('./some');
 
    /**
     * Check if object contains value
     */
    function contains(obj, needle) {
        return some(obj, function(val) {
            return (val === needle);
        });
    }
    module.exports = contains;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/deepFillIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/deepFillIn.js

Statements: 26.67% (4 / 15)      Branches: 0% (0 / 8)      Functions: 0% (0 / 2)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1         1                                               1        
var forOwn = require('./forOwn');
var isPlainObject = require('../lang/isPlainObject');
 
    /**
     * Deeply copy missing properties in the target from the defaults.
     */
    function deepFillIn(target, defaults){
        var i = 0,
            n = arguments.length,
            obj;
 
        while(++i < n) {
            obj = arguments[i];
            if (obj) {
                // jshint loopfunc: true
                forOwn(obj, function(newValue, key) {
                    var curValue = target[key];
                    if (curValue == null) {
                        target[key] = newValue;
                    } else if (isPlainObject(curValue) &&
                               isPlainObject(newValue)) {
                        deepFillIn(curValue, newValue);
                    }
                });
            }
        }
 
        return target;
    }
 
    module.exports = deepFillIn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/deepMatches.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/deepMatches.js

Statements: 25.93% (7 / 27)      Branches: 0% (0 / 16)      Functions: 0% (0 / 5)      Lines: 25.93% (7 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 581 1   1                     1                     1                             1                         1        
var forOwn = require('./forOwn');
var isArray = require('../lang/isArray');
 
    function containsMatch(array, pattern) {
        var i = -1, length = array.length;
        while (++i < length) {
            if (deepMatches(array[i], pattern)) {
                return true;
            }
        }
 
        return false;
    }
 
    function matchArray(target, pattern) {
        var i = -1, patternLength = pattern.length;
        while (++i < patternLength) {
            if (!containsMatch(target, pattern[i])) {
                return false;
            }
        }
 
        return true;
    }
 
    function matchObject(target, pattern) {
        var result = true;
        forOwn(pattern, function(val, key) {
            if (!deepMatches(target[key], val)) {
                // Return false to break out of forOwn early
                return (result = false);
            }
        });
 
        return result;
    }
 
    /**
     * Recursively check if the objects match.
     */
    function deepMatches(target, pattern){
        if (target && typeof target === 'object' &&
            pattern && typeof pattern === 'object') {
            if (isArray(target) && isArray(pattern)) {
                return matchArray(target, pattern);
            } else {
                return matchObject(target, pattern);
            }
        } else {
            return target === pattern;
        }
    }
 
    module.exports = deepMatches;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/deepMixIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/deepMixIn.js

Statements: 93.33% (14 / 15)      Branches: 83.33% (5 / 6)      Functions: 100% (2 / 2)      Lines: 93.33% (14 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361 1           1 1       1 9 9 6       1     1 15 15     15       1        
var forOwn = require('./forOwn');
var isPlainObject = require('../lang/isPlainObject');
 
    /**
     * Mixes objects into the target object, recursively mixing existing child
     * objects.
     */
    function deepMixIn(target, objects) {
        var i = 0,
            n = arguments.length,
            obj;
 
        while(++i < n){
            obj = arguments[i];
            if (obj) {
                forOwn(obj, copyProp, target);
            }
        }
 
        return target;
    }
 
    function copyProp(val, key) {
        var existing = this[key];
        Iif (isPlainObject(val) && isPlainObject(existing)) {
            deepMixIn(existing, val);
        } else {
            this[key] = val;
        }
    }
 
    module.exports = deepMixIn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/equals.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/equals.js

Statements: 53.33% (8 / 15)      Branches: 0% (0 / 10)      Functions: 0% (0 / 4)      Lines: 53.33% (8 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1 1 1       1           1             1                     1      
var hasOwn = require('./hasOwn');
var every = require('./every');
var isObject = require('../lang/isObject');
var is = require('../lang/is');
 
    // Makes a function to compare the object values from the specified compare
    // operation callback.
    function makeCompare(callback) {
        return function(value, key) {
            return hasOwn(this, key) && callback(value, this[key]);
        };
    }
 
    function checkProperties(value, key) {
        return hasOwn(this, key);
    }
 
    /**
     * Checks if two objects have the same keys and values.
     */
    function equals(a, b, callback) {
        callback = callback || is;
 
        if (!isObject(a) || !isObject(b)) {
            return callback(a, b);
        }
 
        return (every(a, makeCompare(callback), b) &&
                every(b, checkProperties, a));
    }
 
    module.exports = equals;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/every.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/every.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1         1                           1        
var forOwn = require('./forOwn');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Object every
     */
    function every(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var result = true;
        forOwn(obj, function(val, key) {
            // we consider any falsy values as "false" on purpose so shorthand
            // syntax can be used to check property existence
            if (!callback(val, key, obj)) {
                result = false;
                return false; // break
            }
        });
        return result;
    }
 
    module.exports = every;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/fillIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/fillIn.js

Statements: 50% (5 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 50% (5 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1 1         1                     1        
var forEach = require('../array/forEach');
var slice = require('../array/slice');
var forOwn = require('./forOwn');
 
    /**
     * Copy missing properties in the obj from the defaults.
     */
    function fillIn(obj, var_defaults){
        forEach(slice(arguments, 1), function(base){
            forOwn(base, function(val, key){
                if (obj[key] == null) {
                    obj[key] = val;
                }
            });
        });
        return obj;
    }
 
    module.exports = fillIn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/filter.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/filter.js

Statements: 40% (4 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 40% (4 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1           1                     1      
var forOwn = require('./forOwn');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Creates a new object with all the properties where the callback returns
     * true.
     */
    function filterValues(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var output = {};
        forOwn(obj, function(value, key, obj) {
            if (callback(value, key, obj)) {
                output[key] = value;
            }
        });
 
        return output;
    }
    module.exports = filterValues;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/find.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/find.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1         1                       1        
var some = require('./some');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Returns first item that matches criteria
     */
    function find(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var result;
        some(obj, function(value, key, obj) {
            if (callback(value, key, obj)) {
                result = value;
                return true; //break
            }
        });
        return result;
    }
 
    module.exports = find;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/flatten.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/flatten.js

Statements: 33.33% (5 / 15)      Branches: 0% (0 / 10)      Functions: 0% (0 / 3)      Lines: 33.33% (5 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 401 1           1                                     1                 1        
var forOwn = require('./forOwn');
var isPlainObject = require('../lang/isPlainObject');
 
    /*
     * Helper function to flatten to a destination object.
     * Used to remove the need to create intermediate objects while flattening.
     */
    function flattenTo(obj, result, prefix, level) {
        forOwn(obj, function (value, key) {
            var nestedPrefix = prefix ? prefix + '.' + key : key;
 
            if (level !== 0 && isPlainObject(value)) {
                flattenTo(value, result, nestedPrefix, level - 1);
            } else {
                result[nestedPrefix] = value;
            }
        });
 
        return result;
    }
 
    /**
     * Recursively flattens an object.
     * A new object containing all the elements is returned.
     * If level is specified, it will only flatten up to that level.
     */
    function flatten(obj, level) {
        if (obj == null) {
            return {};
        }
 
        level = level == null ? -1 : level;
        return flattenTo(obj, {}, '', level);
    }
 
    module.exports = flatten;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/forIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/forIn.js

Statements: 73.91% (17 / 23)      Branches: 25% (4 / 16)      Functions: 100% (3 / 3)      Lines: 72.73% (16 / 22)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 781   1     1 1                   1   1 1                 1 33         33   33 673           33                                                   1 673     1        
var hasOwn = require('./hasOwn');
 
    var _hasDontEnumBug,
        _dontEnums;
 
    function checkDontEnum(){
        _dontEnums = [
                'toString',
                'toLocaleString',
                'valueOf',
                'hasOwnProperty',
                'isPrototypeOf',
                'propertyIsEnumerable',
                'constructor'
            ];
 
        _hasDontEnumBug = true;
 
        for (var key in {'toString': null}) {
            _hasDontEnumBug = false;
        }
    }
 
    /**
     * Similar to Array/forEach but works over object properties and fixes Don't
     * Enum bug on IE.
     * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
     */
    function forIn(obj, fn, thisObj){
        var key, i = 0;
        // no need to check if argument is a real object that way we can use
        // it for arrays, functions, date, etc.
 
        //post-pone check till needed
        if (_hasDontEnumBug == null) checkDontEnum();
 
        for (key in obj) {
            Iif (exec(fn, obj, key, thisObj) === false) {
                break;
            }
        }
 
 
        Iif (_hasDontEnumBug) {
            var ctor = obj.constructor,
                isProto = !!ctor && obj === ctor.prototype;
 
            while (key = _dontEnums[i++]) {
                // For constructor, if it is a prototype object the constructor
                // is always non-enumerable unless defined otherwise (and
                // enumerated above).  For non-prototype objects, it will have
                // to be defined on this object, since it cannot be defined on
                // any prototype objects.
                //
                // For other [[DontEnum]] properties, check if the value is
                // different than Object prototype value.
                if (
                    (key !== 'constructor' ||
                        (!isProto && hasOwn(obj, key))) &&
                    obj[key] !== Object.prototype[key]
                ) {
                    if (exec(fn, obj, key, thisObj) === false) {
                        break;
                    }
                }
            }
        }
    }
 
    function exec(fn, obj, key, thisObj){
        return fn.call(thisObj, obj[key], key, obj);
    }
 
    module.exports = forIn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/forOwn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/forOwn.js

Statements: 100% (7 / 7)      Branches: 50% (1 / 2)      Functions: 100% (2 / 2)      Lines: 100% (7 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1             1 33 673 673         1        
var hasOwn = require('./hasOwn');
var forIn = require('./forIn');
 
    /**
     * Similar to Array/forEach but works over object properties and fixes Don't
     * Enum bug on IE.
     * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
     */
    function forOwn(obj, fn, thisObj){
        forIn(obj, function(val, key){
            Eif (hasOwn(obj, key)) {
                return fn.call(thisObj, obj[key], key, obj);
            }
        });
    }
 
    module.exports = forOwn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/functions.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/functions.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var forIn = require('./forIn');
 
    /**
     * return a list of all enumerable properties that have function values
     */
    function functions(obj){
        var keys = [];
        forIn(obj, function(val, key){
            if (typeof val === 'function'){
                keys.push(key);
            }
        });
        return keys.sort();
    }
 
    module.exports = functions;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/get.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/get.js

Statements: 33.33% (3 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221         1                       1        
var isPrimitive = require('../lang/isPrimitive');
 
    /**
     * get "nested" object property
     */
    function get(obj, prop){
        var parts = prop.split('.'),
            last = parts.pop();
 
        while (prop = parts.shift()) {
            obj = obj[prop];
            if (obj == null) return;
        }
 
        return obj[last];
    }
 
    module.exports = get;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/has.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/has.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171   1         1       1          
var get = require('./get');
 
    var UNDEF;
 
    /**
     * Check if object has nested property.
     */
    function has(obj, prop){
        return get(obj, prop) !== UNDEF;
    }
 
    module.exports = has;
 
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/hasOwn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/hasOwn.js

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (3 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14          1 673     1        
 
 
    /**
     * Safer Object.hasOwnProperty
     */
     function hasOwn(obj, prop){
         return Object.prototype.hasOwnProperty.call(obj, prop);
     }
 
     module.exports = hasOwn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/keys.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/keys.js

Statements: 42.86% (3 / 7)      Branches: 50% (1 / 2)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var forOwn = require('./forOwn');
 
    /**
     * Get object keys
     */
     var keys = Object.keys || function (obj) {
            var keys = [];
            forOwn(obj, function(val, key){
                keys.push(key);
            });
            return keys;
        };
 
    module.exports = keys;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/map.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/map.js

Statements: 88.89% (8 / 9)      Branches: 100% (0 / 0)      Functions: 50% (1 / 2)      Lines: 88.89% (8 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201 1           1 1 1 1       1   1      
var forOwn = require('./forOwn');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Creates a new object where all the values are the result of calling
     * `callback`.
     */
    function mapValues(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var output = {};
        forOwn(obj, function(val, key, obj) {
            output[key] = callback(val, key, obj);
        });
 
        return output;
    }
    module.exports = mapValues;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/matches.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/matches.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221         1                       1        
var forOwn = require('./forOwn');
 
    /**
     * checks if a object contains all given properties/values
     */
    function matches(target, props){
        // can't use "object/every" because of circular dependency
        var result = true;
        forOwn(props, function(val, key){
            if (target[key] !== val) {
                // break loop at first difference
                return (result = false);
            }
        });
        return result;
    }
 
    module.exports = matches;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/max.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/max.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1         1       1      
var arrMax = require('../array/max');
var values = require('./values');
 
    /**
     * Returns maximum value inside object.
     */
    function max(obj, compareFn) {
        return arrMax(values(obj), compareFn);
    }
 
    module.exports = max;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/merge.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/merge.js

Statements: 62.5% (10 / 16)      Branches: 0% (0 / 6)      Functions: 100% (1 / 1)      Lines: 62.5% (10 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421 1 1         1 1         1   1 1                                   1     1        
var hasOwn = require('./hasOwn');
var deepClone = require('../lang/deepClone');
var isObject = require('../lang/isObject');
 
    /**
     * Deep merge objects.
     */
    function merge() {
        var i = 1,
            key, val, obj, target;
 
        // make sure we don't modify source element and it's properties
        // objects are passed by reference
        target = deepClone( arguments[0] );
 
        while (obj = arguments[i++]) {
            for (key in obj) {
                if ( ! hasOwn(obj, key) ) {
                    continue;
                }
 
                val = obj[key];
 
                if ( isObject(val) && isObject(target[key]) ){
                    // inception, deep merge objects
                    target[key] = merge(target[key], val);
                } else {
                    // make sure arrays, regexp, date, objects are cloned
                    target[key] = deepClone(val);
                }
 
            }
        }
 
        return target;
    }
 
    module.exports = merge;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/min.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/min.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1         1       1      
var arrMin = require('../array/min');
var values = require('./values');
 
    /**
     * Returns minimum value inside object.
     */
    function min(obj, iterator) {
        return arrMin(values(obj), iterator);
    }
 
    module.exports = min;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/mixIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/mixIn.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301                 1                         1       1      
var forOwn = require('./forOwn');
 
    /**
    * Combine properties from all the objects into first one.
    * - This method affects target object in place, if you want to create a new Object pass an empty object as first param.
    * @param {object} target    Target Object
    * @param {...object} objects    Objects to be combined (0...n objects).
    * @return {object} Target Object.
    */
    function mixIn(target, objects){
        var i = 0,
            n = arguments.length,
            obj;
        while(++i < n){
            obj = arguments[i];
            if (obj != null) {
                forOwn(obj, copyProp, target);
            }
        }
        return target;
    }
 
    function copyProp(val, key){
        this[key] = val;
    }
 
    module.exports = mixIn;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/namespace.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/namespace.js

Statements: 30% (3 / 10)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 33.33% (3 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211         1                     1        
var forEach = require('../array/forEach');
 
    /**
     * Create nested object if non-existent
     */
    function namespace(obj, path){
        if (!path) return obj;
        forEach(path.split('.'), function(key){
            if (!obj[key]) {
                obj[key] = {};
            }
            obj = obj[key];
        });
        return obj;
    }
 
    module.exports = namespace;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/omit.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/omit.js

Statements: 44.44% (4 / 9)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1         1                       1        
var slice = require('../array/slice');
var contains = require('../array/contains');
 
    /**
     * Return a copy of the object, filtered to only contain properties except the blacklisted keys.
     */
    function omit(obj, var_keys){
        var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1),
            out = {};
 
        for (var property in obj) {
            if (obj.hasOwnProperty(property) && !contains(keys, property)) {
                out[property] = obj[property];
            }
        }
        return out;
    }
 
    module.exports = omit;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/pick.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/pick.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var slice = require('../array/slice');
 
    /**
     * Return a copy of the object, filtered to only have values for the whitelisted keys.
     */
    function pick(obj, var_keys){
        var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1),
            out = {},
            i = 0, key;
        while (key = keys[i++]) {
            out[key] = obj[key];
        }
        return out;
    }
 
    module.exports = pick;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/pluck.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/pluck.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1         1       1        
var map = require('./map');
var prop = require('../function/prop');
 
    /**
     * Extract a list of property values.
     */
    function pluck(obj, propName){
        return map(obj, prop(propName));
    }
 
    module.exports = pluck;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/reduce.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/reduce.js

Statements: 30.77% (4 / 13)      Branches: 0% (0 / 6)      Functions: 0% (0 / 2)      Lines: 30.77% (4 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311 1         1                                       1        
var forOwn = require('./forOwn');
var size = require('./size');
 
    /**
     * Object reduce
     */
    function reduce(obj, callback, memo, thisObj) {
        var initial = arguments.length > 2;
 
        if (!size(obj) && !initial) {
            throw new Error('reduce of empty object with no initial value');
        }
 
        forOwn(obj, function(value, key, list) {
            if (!initial) {
                memo = value;
                initial = true;
            }
            else {
                memo = callback.call(thisObj, memo, value, key, list);
            }
        });
 
        return memo;
    }
 
    module.exports = reduce;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/reject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/reject.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1         1             1        
var filter = require('./filter');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Object reject
     */
    function reject(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        return filter(obj, function(value, index, obj) {
            return !callback(value, index, obj);
        }, thisObj);
    }
 
    module.exports = reject;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/result.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/result.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161   1                   1      
var isFunction = require('../lang/isFunction');
 
    function result(obj, prop) {
        var property = obj[prop];
 
        if(property === undefined) {
            return;
        }
 
        return isFunction(property) ? property.call(obj) : property;
    }
 
    module.exports = result;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/set.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/set.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191         1                 1        
var namespace = require('./namespace');
 
    /**
     * set "nested" object property
     */
    function set(obj, prop, val){
        var parts = (/^(.+)\.(.+)$/).exec(prop);
        if (parts){
            namespace(obj, parts[1])[parts[2]] = val;
        } else {
            obj[prop] = val;
        }
    }
 
    module.exports = set;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/size.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/size.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var forOwn = require('./forOwn');
 
    /**
     * Get object size
     */
    function size(obj) {
        var count = 0;
        forOwn(obj, function(){
            count++;
        });
        return count;
    }
 
    module.exports = size;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/some.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/some.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1         1                       1        
var forOwn = require('./forOwn');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Object some
     */
    function some(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var result = false;
        forOwn(obj, function(val, key) {
            if (callback(val, key, obj)) {
                result = true;
                return false; // break
            }
        });
        return result;
    }
 
    module.exports = some;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/unset.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/unset.js

Statements: 33.33% (3 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 33.33% (3 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251         1                             1        
var has = require('./has');
 
    /**
     * Unset object property.
     */
    function unset(obj, prop){
        if (has(obj, prop)) {
            var parts = prop.split('.'),
                last = parts.pop();
            while (prop = parts.shift()) {
                obj = obj[prop];
            }
            return (delete obj[last]);
 
        } else {
            // if property doesn't exist treat as deleted
            return true;
        }
    }
 
    module.exports = unset;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/values.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/object/values.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var forOwn = require('./forOwn');
 
    /**
     * Get object values
     */
    function values(obj) {
        var vals = [];
        forOwn(obj, function(val, key){
            vals.push(val);
        });
        return vals;
    }
 
    module.exports = values;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/

Statements: 51.94% (161 / 310)      Branches: 1.32% (1 / 76)      Functions: 12.2% (5 / 41)      Lines: 51.94% (161 / 310)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/
File Statements Branches Functions Lines
WHITE_SPACES.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
camelCase.js 100% (11 / 11) 100% (0 / 0) 100% (1 / 1) 100% (11 / 11)
contains.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 1) 50% (3 / 6)
crop.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
endsWith.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 1) 50% (3 / 6)
escapeHtml.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
escapeRegExp.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
escapeUnicode.js 37.5% (3 / 8) 0% (0 / 4) 0% (0 / 2) 37.5% (3 / 8)
hyphenate.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
insert.js 44.44% (4 / 9) 0% (0 / 2) 0% (0 / 1) 44.44% (4 / 9)
interpolate.js 55.56% (5 / 9) 0% (0 / 2) 0% (0 / 2) 55.56% (5 / 9)
lowerCase.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
lpad.js 57.14% (4 / 7) 0% (0 / 4) 0% (0 / 1) 57.14% (4 / 7)
ltrim.js 23.53% (4 / 17) 0% (0 / 8) 0% (0 / 1) 23.53% (4 / 17)
makePath.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
normalizeLineBreaks.js 50% (3 / 6) 0% (0 / 2) 0% (0 / 1) 50% (3 / 6)
pascalCase.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 1) 71.43% (5 / 7)
properCase.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 1) 71.43% (5 / 7)
removeNonASCII.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
removeNonWord.js 100% (6 / 6) 100% (0 / 0) 100% (1 / 1) 100% (6 / 6)
repeat.js 26.67% (4 / 15) 0% (0 / 4) 0% (0 / 1) 26.67% (4 / 15)
replace.js 28.57% (4 / 14) 0% (0 / 6) 0% (0 / 1) 28.57% (4 / 14)
replaceAccents.js 85.71% (6 / 7) 50% (1 / 2) 100% (1 / 1) 85.71% (6 / 7)
rpad.js 57.14% (4 / 7) 0% (0 / 4) 0% (0 / 1) 57.14% (4 / 7)
rtrim.js 23.53% (4 / 17) 0% (0 / 8) 0% (0 / 1) 23.53% (4 / 17)
sentenceCase.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 1) 71.43% (5 / 7)
slugify.js 46.15% (6 / 13) 0% (0 / 2) 0% (0 / 1) 46.15% (6 / 13)
startsWith.js 100% (6 / 6) 100% (0 / 0) 100% (1 / 1) 100% (6 / 6)
stripHtmlTags.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
trim.js 66.67% (6 / 9) 0% (0 / 2) 0% (0 / 1) 66.67% (6 / 9)
truncate.js 30.77% (4 / 13) 0% (0 / 8) 0% (0 / 1) 30.77% (4 / 13)
typecast.js 18.75% (3 / 16) 0% (0 / 16) 0% (0 / 1) 18.75% (3 / 16)
unCamelCase.js 41.67% (5 / 12) 0% (0 / 2) 0% (0 / 2) 41.67% (5 / 12)
underscore.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
unescapeHtml.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
unescapeUnicode.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
unhyphenate.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
upperCase.js 100% (5 / 5) 100% (0 / 0) 100% (1 / 1) 100% (5 / 5)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14          1                
 
    /**
     * Contains all Unicode white-spaces. Taken from
     * http://en.wikipedia.org/wiki/Whitespace_character.
     */
    module.exports = [
        ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E',
        '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006',
        '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F',
        '\u205F', '\u3000'
    ];
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/camelCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/camelCase.js

Statements: 100% (11 / 11)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (11 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1 1 1 1       1 38 38 38         38   1      
var toString = require('../lang/toString');
var replaceAccents = require('./replaceAccents');
var removeNonWord = require('./removeNonWord');
var upperCase = require('./upperCase');
var lowerCase = require('./lowerCase');
    /**
    * Convert string to camelCase text.
    */
    function camelCase(str){
        str = toString(str);
        str = replaceAccents(str);
        str = removeNonWord(str)
            .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces
            .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE
            .replace(/\s+/g, '') //remove spaces
            .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase
        return str;
    }
    module.exports = camelCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/contains.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/contains.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161         1           1        
var toString = require('../lang/toString');
 
    /**
     * Searches for a given substring
     */
    function contains(str, substring, fromIndex){
        str = toString(str);
        substring = toString(substring);
        return str.indexOf(substring, fromIndex) !== -1;
    }
 
    module.exports = contains;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/crop.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/crop.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1       1         1      
var toString = require('../lang/toString');
var truncate = require('./truncate');
    /**
     * Truncate string at full words.
     */
     function crop(str, maxChars, append) {
         str = toString(str);
         return truncate(str, maxChars, append, true);
     }
 
     module.exports = crop;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/endsWith.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/endsWith.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151       1             1      
var toString = require('../lang/toString');
    /**
     * Checks if string ends with specified suffix.
     */
    function endsWith(str, suffix) {
        str = toString(str);
        suffix = toString(suffix);
 
        return str.indexOf(suffix, str.length - suffix.length) !== -1;
    }
 
    module.exports = endsWith;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/escapeHtml.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/escapeHtml.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var toString = require('../lang/toString');
 
    /**
     * Escapes a string for insertion into HTML.
     */
    function escapeHtml(str){
        str = toString(str)
            .replace(/&/g, '&amp;')
            .replace(/</g, '&lt;')
            .replace(/>/g, '&gt;')
            .replace(/'/g, '&#39;')
            .replace(/"/g, '&quot;');
        return str;
    }
 
    module.exports = escapeHtml;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1       1        
var toString = require('../lang/toString');
 
    /**
     * Escape RegExp string chars.
     */
    function escapeRegExp(str) {
        return toString(str).replace(/\W/g,'\\$&');
    }
 
    module.exports = escapeRegExp;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231         1                         1        
var toString = require('../lang/toString');
 
    /**
     * Escape string into unicode sequences
     */
    function escapeUnicode(str, shouldEscapePrintable){
        str = toString(str);
        return str.replace(/[\s\S]/g, function(ch){
            // skip printable ASCII chars if we should not escape them
            if (!shouldEscapePrintable && (/[\x20-\x7E]/).test(ch)) {
                return ch;
            }
            // we use "000" and slice(-4) for brevity, need to pad zeros,
            // unicode escape always have 4 chars after "\u"
            return '\\u'+ ('000'+ ch.charCodeAt(0).toString(16)).slice(-4);
        });
    }
 
    module.exports = escapeUnicode;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/hyphenate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/hyphenate.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1 1       1           1      
var toString = require('../lang/toString');
var slugify = require('./slugify');
var unCamelCase = require('./unCamelCase');
    /**
     * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case.
     */
    function hyphenate(str){
        str = toString(str);
        str = unCamelCase(str);
        return slugify(str, "-");
    }
 
    module.exports = hyphenate;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/insert.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/insert.js

Statements: 44.44% (4 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1         1                       1        
var clamp = require('../math/clamp');
var toString = require('../lang/toString');
 
    /**
     * Inserts a string at a given index.
     */
    function insert(string, index, partial){
        string = toString(string);
 
        if (index < 0) {
            index = string.length + index;
        }
 
        index = clamp(index, 0, string.length);
 
        return string.substr(0, index) + partial + string.substr(index);
    }
 
    module.exports = insert;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/interpolate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/interpolate.js

Statements: 55.56% (5 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 55.56% (5 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1   1         1               1        
var toString = require('../lang/toString');
var get = require('../object/get');
 
    var stache = /\{\{([^\}]+)\}\}/g; //mustache-like
 
    /**
     * String interpolation
     */
    function interpolate(template, replacements, syntax){
        template = toString(template);
        var replaceFn = function(match, prop){
            return toString( get(replacements, prop) );
        };
        return template.replace(syntax || stache, replaceFn);
    }
 
    module.exports = interpolate;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/lowerCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/lowerCase.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131       1         1      
var toString = require('../lang/toString');
    /**
     * "Safer" String.toLowerCase()
     */
    function lowerCase(str){
        str = toString(str);
        return str.toLowerCase();
    }
 
    module.exports = lowerCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/lpad.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/lpad.js

Statements: 57.14% (4 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191 1         1               1        
var toString = require('../lang/toString');
var repeat = require('./repeat');
 
    /**
     * Pad string with `char` if its' length is smaller than `minLen`
     */
    function lpad(str, minLen, ch) {
        str = toString(str);
        ch = ch || ' ';
 
        return (str.length < minLen) ?
            repeat(ch, minLen - str.length) + str : str;
    }
 
    module.exports = lpad;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/ltrim.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/ltrim.js

Statements: 23.53% (4 / 17)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 23.53% (4 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361 1       1                                                     1      
var toString = require('../lang/toString');
var WHITE_SPACES = require('./WHITE_SPACES');
    /**
     * Remove chars from beginning of string.
     */
    function ltrim(str, chars) {
        str = toString(str);
        chars = chars || WHITE_SPACES;
 
        var start = 0,
            len = str.length,
            charLen = chars.length,
            found = true,
            i, c;
 
        while (found && start < len) {
            found = false;
            i = -1;
            c = str.charAt(start);
 
            while (++i < charLen) {
                if (c === chars[i]) {
                    found = true;
                    start++;
                    break;
                }
            }
        }
 
        return (start >= len) ? '' : str.substr(start, len);
    }
 
    module.exports = ltrim;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/makePath.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/makePath.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1           1           1      
var join = require('../array/join');
var slice = require('../array/slice');
 
    /**
     * Group arguments as path segments, if any of the args is `null` or an
     * empty string it will be ignored from resulting path.
     */
    function makePath(var_args){
        var result = join(slice(arguments), '/');
        // need to disconsider duplicate '/' after protocol (eg: 'http://')
        return result.replace(/([^:\/]|^)\/{2,}/g, '$1/');
    }
 
    module.exports = makePath;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js

Statements: 50% (3 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var toString = require('../lang/toString');
 
    /**
     * Convert line-breaks from DOS/MAC to a single standard (UNIX by default)
     */
    function normalizeLineBreaks(str, lineEnd) {
        str = toString(str);
        lineEnd = lineEnd || '\n';
 
        return str
            .replace(/\r\n/g, lineEnd) // DOS
            .replace(/\r/g, lineEnd)   // Mac
            .replace(/\n/g, lineEnd);  // Unix
    }
 
    module.exports = normalizeLineBreaks;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/pascalCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/pascalCase.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1       1         1      
var toString = require('../lang/toString');
var camelCase = require('./camelCase');
var upperCase = require('./upperCase');
    /**
     * camelCase + UPPERCASE first char
     */
    function pascalCase(str){
        str = toString(str);
        return camelCase(str).replace(/^[a-z]/, upperCase);
    }
 
    module.exports = pascalCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/properCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/properCase.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1       1         1      
var toString = require('../lang/toString');
var lowerCase = require('./lowerCase');
var upperCase = require('./upperCase');
    /**
     * UPPERCASE first char of each word.
     */
    function properCase(str){
        str = toString(str);
        return lowerCase(str).replace(/^\w|\s\w/g, upperCase);
    }
 
    module.exports = properCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161       1               1      
var toString = require('../lang/toString');
    /**
     * Remove non-printable ASCII chars
     */
    function removeNonASCII(str){
        str = toString(str);
 
        // Matches non-printable ASCII chars -
        // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
        return str.replace(/[^\x20-\x7E]/g, '');
    }
 
    module.exports = removeNonASCII;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/removeNonWord.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/removeNonWord.js

Statements: 100% (6 / 6)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (6 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161   1         1 38 38     1      
var toString = require('../lang/toString');
    // This pattern is generated by the _build/pattern-removeNonWord.js script
    var PATTERN = /[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;
 
    /**
     * Remove non-word chars.
     */
    function removeNonWord(str){
        str = toString(str);
        return str.replace(PATTERN, '');
    }
 
    module.exports = removeNonWord;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/repeat.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/repeat.js

Statements: 26.67% (4 / 15)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 281 1         1                                 1        
var toString = require('../lang/toString');
var toInt = require('../number/toInt');
 
    /**
     * Repeat string n times
     */
     function repeat(str, n){
         var result = '';
         str = toString(str);
         n = toInt(n);
        if (n < 1) {
            return '';
        }
        while (n > 0) {
            if (n % 2) {
                result += str;
            }
            n = Math.floor(n / 2);
            str += str;
        }
        return result;
     }
 
     module.exports = repeat;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/replace.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/replace.js

Statements: 28.57% (4 / 14)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 28.57% (4 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1         1                                               1        
var toString = require('../lang/toString');
var toArray = require('../lang/toArray');
 
    /**
     * Replace string(s) with the replacement(s) in the source.
     */
    function replace(str, search, replacements) {
        str = toString(str);
        search = toArray(search);
        replacements = toArray(replacements);
 
        var searchLength = search.length,
            replacementsLength = replacements.length;
 
        if (replacementsLength !== 1 && searchLength !== replacementsLength) {
            throw new Error('Unequal number of searches and replacements');
        }
 
        var i = -1;
        while (++i < searchLength) {
            // Use the first replacement for all searches if only one
            // replacement is provided
            str = str.replace(
                search[i],
                replacements[(replacementsLength === 1) ? 0 : i]);
        }
 
        return str;
    }
 
    module.exports = replace;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/replaceAccents.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/replaceAccents.js

Statements: 85.71% (6 / 7)      Branches: 50% (1 / 2)      Functions: 100% (1 / 1)      Lines: 85.71% (6 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 381       1 38     38                                               38   1      
var toString = require('../lang/toString');
    /**
    * Replaces all accented chars with regular ones
    */
    function replaceAccents(str){
        str = toString(str);
 
        // verifies if the String has accents and replace them
        Iif (str.search(/[\xC0-\xFF]/g) > -1) {
            str = str
                    .replace(/[\xC0-\xC5]/g, "A")
                    .replace(/[\xC6]/g, "AE")
                    .replace(/[\xC7]/g, "C")
                    .replace(/[\xC8-\xCB]/g, "E")
                    .replace(/[\xCC-\xCF]/g, "I")
                    .replace(/[\xD0]/g, "D")
                    .replace(/[\xD1]/g, "N")
                    .replace(/[\xD2-\xD6\xD8]/g, "O")
                    .replace(/[\xD9-\xDC]/g, "U")
                    .replace(/[\xDD]/g, "Y")
                    .replace(/[\xDE]/g, "P")
                    .replace(/[\xE0-\xE5]/g, "a")
                    .replace(/[\xE6]/g, "ae")
                    .replace(/[\xE7]/g, "c")
                    .replace(/[\xE8-\xEB]/g, "e")
                    .replace(/[\xEC-\xEF]/g, "i")
                    .replace(/[\xF1]/g, "n")
                    .replace(/[\xF2-\xF6\xF8]/g, "o")
                    .replace(/[\xF9-\xFC]/g, "u")
                    .replace(/[\xFE]/g, "p")
                    .replace(/[\xFD\xFF]/g, "y");
        }
        return str;
    }
    module.exports = replaceAccents;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/rpad.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/rpad.js

Statements: 57.14% (4 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1         1           1        
var toString = require('../lang/toString');
var repeat = require('./repeat');
 
    /**
     * Pad string with `char` if its' length is smaller than `minLen`
     */
    function rpad(str, minLen, ch) {
        str = toString(str);
        ch = ch || ' ';
        return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str;
    }
 
    module.exports = rpad;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/rtrim.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/rtrim.js

Statements: 23.53% (4 / 17)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 23.53% (4 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1       1                                                   1      
var toString = require('../lang/toString');
var WHITE_SPACES = require('./WHITE_SPACES');
    /**
     * Remove chars from end of string.
     */
    function rtrim(str, chars) {
        str = toString(str);
        chars = chars || WHITE_SPACES;
 
        var end = str.length - 1,
            charLen = chars.length,
            found = true,
            i, c;
 
        while (found && end >= 0) {
            found = false;
            i = -1;
            c = str.charAt(end);
 
            while (++i < charLen) {
                if (c === chars[i]) {
                    found = true;
                    end--;
                    break;
                }
            }
        }
 
        return (end >= 0) ? str.substring(0, end + 1) : '';
    }
 
    module.exports = rtrim;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/sentenceCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/sentenceCase.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1       1             1      
var toString = require('../lang/toString');
var lowerCase = require('./lowerCase');
var upperCase = require('./upperCase');
    /**
     * UPPERCASE first char of each sentence and lowercase other chars.
     */
    function sentenceCase(str){
        str = toString(str);
 
        // Replace first char of each sentence (new line or after '.\s+') to
        // UPPERCASE
        return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase);
    }
    module.exports = sentenceCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/slugify.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/slugify.js

Statements: 46.15% (6 / 13)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 46.15% (6 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1 1 1           1                         1      
var toString = require('../lang/toString');
var replaceAccents = require('./replaceAccents');
var removeNonWord = require('./removeNonWord');
var trim = require('./trim');
    /**
     * Convert to lower case, remove accents, remove non-word chars and
     * replace spaces with the specified delimeter.
     * Does not split camelCase text.
     */
    function slugify(str, delimeter){
        str = toString(str);
 
        if (delimeter == null) {
            delimeter = "-";
        }
        str = replaceAccents(str);
        str = removeNonWord(str);
        str = trim(str) //should come after removeNonWord
                .replace(/ +/g, delimeter) //replace spaces with delimeter
                .toLowerCase();
        return str;
    }
    module.exports = slugify;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/startsWith.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/startsWith.js

Statements: 100% (6 / 6)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (6 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151       1 536 536   536     1      
var toString = require('../lang/toString');
    /**
     * Checks if string starts with specified prefix.
     */
    function startsWith(str, prefix) {
        str = toString(str);
        prefix = toString(prefix);
 
        return str.indexOf(prefix) === 0;
    }
 
    module.exports = startsWith;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131       1         1      
var toString = require('../lang/toString');
    /**
     * Remove HTML tags from string.
     */
    function stripHtmlTags(str){
        str = toString(str);
 
        return str.replace(/<[^>]*>/g, '');
    }
    module.exports = stripHtmlTags;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/trim.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/trim.js

Statements: 66.67% (6 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 66.67% (6 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1 1       1           1      
var toString = require('../lang/toString');
var WHITE_SPACES = require('./WHITE_SPACES');
var ltrim = require('./ltrim');
var rtrim = require('./rtrim');
    /**
     * Remove white-spaces from beginning and end of string.
     */
    function trim(str, chars) {
        str = toString(str);
        chars = chars || WHITE_SPACES;
        return ltrim(rtrim(str, chars), chars);
    }
 
    module.exports = trim;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/truncate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/truncate.js

Statements: 30.77% (4 / 13)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 30.77% (4 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1       1                           1      
var toString = require('../lang/toString');
var trim = require('./trim');
    /**
     * Limit number of chars.
     */
    function truncate(str, maxChars, append, onlyFullWords){
        str = toString(str);
        append = append || '...';
        maxChars = onlyFullWords? maxChars + 1 : maxChars;
 
        str = trim(str);
        if(str.length <= maxChars){
            return str;
        }
        str = str.substr(0, maxChars - append.length);
        //crop at last space or remove trailing whitespace
        str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str);
        return str + append;
    }
    module.exports = truncate;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/typecast.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/typecast.js

Statements: 18.75% (3 / 16)      Branches: 0% (0 / 16)      Functions: 0% (0 / 1)      Lines: 18.75% (3 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31    1         1                                       1      
 
 
    var UNDEF;
 
    /**
     * Parses string and convert it into a native value.
     */
    function typecast(val) {
        var r;
        if ( val === null || val === 'null' ) {
            r = null;
        } else if ( val === 'true' ) {
            r = true;
        } else if ( val === 'false' ) {
            r = false;
        } else if ( val === UNDEF || val === 'undefined' ) {
            r = UNDEF;
        } else if ( val === '' || isNaN(val) ) {
            //isNaN('') returns false
            r = val;
        } else {
            //parseFloat(null || '') returns NaN
            r = parseFloat(val);
        }
        return r;
    }
 
    module.exports = typecast;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/unCamelCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/unCamelCase.js

Statements: 41.67% (5 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 41.67% (5 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251   1         1         1                 1      
var toString = require('../lang/toString');
 
    var CAMEL_CASE_BORDER = /([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g;
 
    /**
     * Add space between camelCase text.
     */
    function unCamelCase(str, delimiter){
        if (delimiter == null) {
            delimiter = ' ';
        }
 
        function join(str, c1, c2) {
            return c1 + delimiter + c2;
        }
 
        str = toString(str);
        str = str.replace(CAMEL_CASE_BORDER, join);
        str = str.toLowerCase(); //add space between camelCase text
        return str;
    }
    module.exports = unCamelCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/underscore.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/underscore.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1       1         1      
var toString = require('../lang/toString');
var slugify = require('./slugify');
var unCamelCase = require('./unCamelCase');
    /**
     * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case.
     */
    function underscore(str){
        str = toString(str);
        str = unCamelCase(str);
        return slugify(str, "_");
    }
    module.exports = underscore;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var toString = require('../lang/toString');
 
    /**
     * Unescapes HTML special chars
     */
    function unescapeHtml(str){
        str = toString(str)
            .replace(/&amp;/g , '&')
            .replace(/&lt;/g  , '<')
            .replace(/&gt;/g  , '>')
            .replace(/&#0*39;/g , "'")
            .replace(/&quot;/g, '"');
        return str;
    }
 
    module.exports = unescapeHtml;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var toString = require('../lang/toString');
 
    /**
     * Unescape unicode char sequences
     */
    function unescapeUnicode(str){
        str = toString(str);
        return str.replace(/\\u[0-9a-f]{4}/g, function(ch){
            var code = parseInt(ch.slice(2), 16);
            return String.fromCharCode(code);
        });
    }
 
    module.exports = unescapeUnicode;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/unhyphenate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/unhyphenate.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121       1       1      
var toString = require('../lang/toString');
    /**
     * Replaces hyphens with spaces. (only hyphens between word chars)
     */
    function unhyphenate(str){
        str = toString(str);
        return str.replace(/(\w)(-)(\w)/g, '$1 $3');
    }
    module.exports = unhyphenate;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/upperCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/string/upperCase.js

Statements: 100% (5 / 5)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (5 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121       1 3 3   1      
var toString = require('../lang/toString');
    /**
     * "Safer" String.toUpperCase()
     */
    function upperCase(str){
        str = toString(str);
        return str.toUpperCase();
    }
    module.exports = upperCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-logger/lib/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-logger/lib/

Statements: 22.86% (16 / 70)      Branches: 0% (0 / 18)      Functions: 6.67% (1 / 15)      Lines: 22.86% (16 / 70)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/bower-logger/lib/
File Statements Branches Functions Lines
Logger.js 22.86% (16 / 70) 0% (0 / 18) 6.67% (1 / 15) 22.86% (16 / 70)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js

Statements: 22.86% (16 / 70)      Branches: 0% (0 / 18)      Functions: 6.67% (1 / 15)      Lines: 22.86% (16 / 70)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 1521 1   1   1         1   1         1                                         1           1             1                           1                                                                                                                         1             1                   1 6         1    
var EventEmitter = require('events').EventEmitter;
var util = require('util');
 
var slice = Array.prototype.slice;
 
function Logger() {
    this._interceptors = [];
    this._piped = [];
}
 
util.inherits(Logger, EventEmitter);
 
Logger.prototype.intercept = function (fn) {
    this._interceptors.push(fn);
    return this;
};
 
Logger.prototype.emit = function () {
    var ret;
    var args = slice.call(arguments);
 
    // Run interceptors before
    if (args[0] === 'log') {
        this._interceptors.forEach(function (interceptor) {
            interceptor.apply(this, args.slice(1));
        });
    }
 
    ret = EventEmitter.prototype.emit.apply(this, args);
 
    // Pipe
    this._piped.forEach(function (emitter) {
        emitter.emit.apply(emitter, args);
    });
 
    return ret;
};
 
Logger.prototype.pipe = function (emitter) {
    this._piped.push(emitter);
 
    return emitter;
};
 
Logger.prototype.geminate = function () {
    var logger = new Logger();
 
    logger.pipe(this);
    return logger;
};
 
Logger.prototype.log = function (level, id, message, data) {
    var log = {
        level: level,
        id: id,
        message: message,
        data: data || {}
    };
 
    // Emit log
    this.emit('log', log);
 
    return this;
};
 
Logger.prototype.prompt = function (prompts, callback) {
    var fn;
    var one;
    var invalid;
    var runned;
    var error;
    var validPrompts = Logger._validPrompts;
 
    if (!Array.isArray(prompts)) {
        prompts.name = 'prompt';
        prompts = [prompts];
        one = true;
    }
 
    // Validate prompt types
    invalid = prompts.some(function (prompt) {
        return validPrompts.indexOf(prompt.type) === -1;
    });
 
    if (invalid) {
        error = new Error('Unknown prompt type');
        error.code = 'ENOTSUP';
        return callback(error);
    }
 
    fn = function (answers) {
        // Run callback only once
        if (runned) {
            return;
        }
 
        // Trim answers automatically
        Object.keys(answers).forEach(function (key) {
            var value = answers[key];
 
            if (typeof value === 'string') {
                answers[key] = value.trim();
            } else if (Array.isArray(value)) {
                answers[key] = value.map(function (item) {
                    if (typeof item === 'string') {
                        return item.trim();
                    }
                });
            }
        });
 
        runned = true;
 
        // If only one prompt was requested, resolve with its answer
        if (one) {
            answers = answers.prompt;
        }
 
        callback(null, answers);
    };
 
    this.emit('prompt', prompts, fn);
};
 
// ------------------
 
Logger._validPrompts = [
    'input',
    'confirm',
    'password',
    'checkbox'
];
 
Logger.LEVELS = {
    'error': 5,
    'conflict': 4,
    'warn': 3,
    'action': 2,
    'info': 1,
    'debug': 0
};
 
// Add helpful log methods
Object.keys(Logger.LEVELS).forEach(function (level) {
    Logger.prototype[level] = function (id, message, data) {
        this.log(level, id, message, data);
    };
});
 
module.exports = Logger;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/brace-expansion/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/brace-expansion/

Statements: 17.27% (19 / 110)      Branches: 0% (0 / 55)      Functions: 0% (0 / 13)      Lines: 17.59% (19 / 108)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/brace-expansion/
File Statements Branches Functions Lines
index.js 17.27% (19 / 110) 0% (0 / 55) 0% (0 / 13) 17.59% (19 / 108)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/brace-expansion/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/brace-expansion/index.js

Statements: 17.27% (19 / 110)      Branches: 0% (0 / 55)      Functions: 0% (0 / 13)      Lines: 17.59% (19 / 108)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 2031 1   1   1 1 1 1 1   1           1               1                       1                                                     1                                 1       1     1       1     1       1                                                                                                                                                                                                              
var concatMap = require('concat-map');
var balanced = require('balanced-match');
 
module.exports = expandTop;
 
var escSlash = '\0SLASH'+Math.random()+'\0';
var escOpen = '\0OPEN'+Math.random()+'\0';
var escClose = '\0CLOSE'+Math.random()+'\0';
var escComma = '\0COMMA'+Math.random()+'\0';
var escPeriod = '\0PERIOD'+Math.random()+'\0';
 
function numeric(str) {
  return parseInt(str, 10) == str
    ? parseInt(str, 10)
    : str.charCodeAt(0);
}
 
function escapeBraces(str) {
  return str.split('\\\\').join(escSlash)
            .split('\\{').join(escOpen)
            .split('\\}').join(escClose)
            .split('\\,').join(escComma)
            .split('\\.').join(escPeriod);
}
 
function unescapeBraces(str) {
  return str.split(escSlash).join('\\')
            .split(escOpen).join('{')
            .split(escClose).join('}')
            .split(escComma).join(',')
            .split(escPeriod).join('.');
}
 
 
// Basically just str.split(","), but handling cases
// where we have nested braced sections, which should be
// treated as individual members, like {a,{b,c},d}
function parseCommaParts(str) {
  if (!str)
    return [''];
 
  var parts = [];
  var m = balanced('{', '}', str);
 
  if (!m)
    return str.split(',');
 
  var pre = m.pre;
  var body = m.body;
  var post = m.post;
  var p = pre.split(',');
 
  p[p.length-1] += '{' + body + '}';
  var postParts = parseCommaParts(post);
  if (post.length) {
    p[p.length-1] += postParts.shift();
    p.push.apply(p, postParts);
  }
 
  parts.push.apply(parts, p);
 
  return parts;
}
 
function expandTop(str) {
  if (!str)
    return [];
 
  // I don't know why Bash 4.3 does this, but it does.
  // Anything starting with {} will have the first two bytes preserved
  // but *only* at the top level, so {},a}b will not expand to anything,
  // but a{},b}c will be expanded to [a}c,abc].
  // One could argue that this is a bug in Bash, but since the goal of
  // this module is to match Bash's rules, we escape a leading {}
  if (str.substr(0, 2) === '{}') {
    str = '\\{\\}' + str.substr(2);
  }
 
  return expand(escapeBraces(str), true).map(unescapeBraces);
}
 
function identity(e) {
  return e;
}
 
function embrace(str) {
  return '{' + str + '}';
}
function isPadded(el) {
  return /^-?0\d/.test(el);
}
 
function lte(i, y) {
  return i <= y;
}
function gte(i, y) {
  return i >= y;
}
 
function expand(str, isTop) {
  var expansions = [];
 
  var m = balanced('{', '}', str);
  if (!m || /\$$/.test(m.pre)) return [str];
 
  var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  var isSequence = isNumericSequence || isAlphaSequence;
  var isOptions = /^(.*,)+(.+)?$/.test(m.body);
  if (!isSequence && !isOptions) {
    // {a},b}
    if (m.post.match(/,.*\}/)) {
      str = m.pre + '{' + m.body + escClose + m.post;
      return expand(str);
    }
    return [str];
  }
 
  var n;
  if (isSequence) {
    n = m.body.split(/\.\./);
  } else {
    n = parseCommaParts(m.body);
    if (n.length === 1) {
      // x{{a,b}}y ==> x{a}y x{b}y
      n = expand(n[0], false).map(embrace);
      if (n.length === 1) {
        var post = m.post.length
          ? expand(m.post, false)
          : [''];
        return post.map(function(p) {
          return m.pre + n[0] + p;
        });
      }
    }
  }
 
  // at this point, n is the parts, and we know it's not a comma set
  // with a single entry.
 
  // no need to expand pre, since it is guaranteed to be free of brace-sets
  var pre = m.pre;
  var post = m.post.length
    ? expand(m.post, false)
    : [''];
 
  var N;
 
  if (isSequence) {
    var x = numeric(n[0]);
    var y = numeric(n[1]);
    var width = Math.max(n[0].length, n[1].length)
    var incr = n.length == 3
      ? Math.abs(numeric(n[2]))
      : 1;
    var test = lte;
    var reverse = y < x;
    if (reverse) {
      incr *= -1;
      test = gte;
    }
    var pad = n.some(isPadded);
 
    N = [];
 
    for (var i = x; test(i, y); i += incr) {
      var c;
      if (isAlphaSequence) {
        c = String.fromCharCode(i);
        if (c === '\\')
          c = '';
      } else {
        c = String(i);
        if (pad) {
          var need = width - c.length;
          if (need > 0) {
            var z = new Array(need + 1).join('0');
            if (i < 0)
              c = '-' + z + c.slice(1);
            else
              c = z + c;
          }
        }
      }
      N.push(c);
    }
  } else {
    N = concatMap(n, function(el) { return expand(el, false) });
  }
 
  for (var j = 0; j < N.length; j++) {
    for (var k = 0; k < post.length; k++) {
      var expansion = pre + N[j] + post[k];
      if (!isTop || isSequence || expansion)
        expansions.push(expansion);
    }
  }
 
  return expansions;
}
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/concat-map/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/concat-map/

Statements: 20% (2 / 10)      Branches: 25% (1 / 4)      Functions: 0% (0 / 2)      Lines: 22.22% (2 / 9)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/concat-map/
File Statements Branches Functions Lines
index.js 20% (2 / 10) 25% (1 / 4) 0% (0 / 2) 22.22% (2 / 9)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/concat-map/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/concat-map/index.js

Statements: 20% (2 / 10)      Branches: 25% (1 / 4)      Functions: 0% (0 / 2)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151                   1        
module.exports = function (xs, fn) {
    var res = [];
    for (var i = 0; i < xs.length; i++) {
        var x = fn(xs[i], i);
        if (isArray(x)) res.push.apply(res, x);
        else res.push(x);
    }
    return res;
};
 
var isArray = Array.isArray || function (xs) {
    return Object.prototype.toString.call(xs) === '[object Array]';
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/

Statements: 56.14% (32 / 57)      Branches: 33.33% (8 / 24)      Functions: 30% (3 / 10)      Lines: 56.14% (32 / 57)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/
File Statements Branches Functions Lines
index.js 56.14% (32 / 57) 33.33% (8 / 24) 30% (3 / 10) 56.14% (32 / 57)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/index.js

Statements: 56.14% (32 / 57)      Branches: 33.33% (8 / 24)      Functions: 30% (3 / 10)      Lines: 56.14% (32 / 57)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113  1 1 1 1 1 1 1 1 1 1   1 1 1 1 1   1 1   1       1   1     1     2 2                                             1     1   1                                   1       1                       1       1           1       1    
'use strict';
var path = require('path');
var fs = require('graceful-fs');
var osenv = require('osenv');
var assign = require('object-assign');
var mkdirp = require('mkdirp');
var uuid = require('uuid');
var xdgBasedir = require('xdg-basedir');
var osTmpdir = require('os-tmpdir');
var writeFileAtomic = require('write-file-atomic');
var dotProp = require('dot-prop');
 
var user = (osenv.user() || uuid.v4()).replace(/\\/g, '');
var configDir = xdgBasedir.config || path.join(osTmpdir(), user, '.config');
var permissionError = 'You don\'t have access to this file.';
var defaultPathMode = parseInt('0700', 8);
var writeFileOptions = {mode: parseInt('0600', 8)};
 
function Configstore(id, defaults, opts) {
	opts = opts || {};
 
	var pathPrefix = opts.globalConfigPath ?
		path.join(id, 'config.json') :
		path.join('configstore', id + '.json');
 
	this.path = path.join(configDir, pathPrefix);
 
	this.all = assign({}, defaults || {}, this.all || {});
}
 
Configstore.prototype = Object.create(Object.prototype, {
	all: {
		get: function () {
			try {
				return JSON.parse(fs.readFileSync(this.path, 'utf8'));
			} catch (err) {
				// create dir if it doesn't exist
				if (err.code === 'ENOENT') {
					mkdirp.sync(path.dirname(this.path), defaultPathMode);
					return {};
				}
 
				// improve the message of permission errors
				if (err.code === 'EACCES') {
					err.message = err.message + '\n' + permissionError + '\n';
				}
 
				// empty the file if it encounters invalid JSON
				if (err.name === 'SyntaxError') {
					writeFileAtomic.sync(this.path, '', writeFileOptions);
					return {};
				}
 
				throw err;
			}
		},
		set: function (val) {
			try {
				// make sure the folder exists as it
				// could have been deleted in the meantime
				mkdirp.sync(path.dirname(this.path), defaultPathMode);
 
				writeFileAtomic.sync(this.path, JSON.stringify(val, null, '\t'), writeFileOptions);
			} catch (err) {
				// improve the message of permission errors
				if (err.code === 'EACCES') {
					err.message = err.message + '\n' + permissionError + '\n';
				}
 
				throw err;
			}
		}
	},
	size: {
		get: function () {
			return Object.keys(this.all || {}).length;
		}
	}
});
 
Configstore.prototype.get = function (key) {
	return dotProp.get(this.all, key);
};
 
Configstore.prototype.set = function (key, val) {
	var config = this.all;
	if (arguments.length === 1) {
		Object.keys(key).forEach(function (k) {
			dotProp.set(config, k, key[k]);
		});
	} else {
		dotProp.set(config, key, val);
	}
	this.all = config;
};
 
Configstore.prototype.has = function (key) {
	return dotProp.has(this.all, key);
};
 
Configstore.prototype.delete = Configstore.prototype.del = function (key) {
	var config = this.all;
	dotProp.delete(config, key);
	this.all = config;
};
 
Configstore.prototype.clear = function () {
	this.all = {};
};
 
module.exports = Configstore;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/node_modules/object-assign/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/node_modules/object-assign/

Statements: 48.84% (21 / 43)      Branches: 25% (5 / 20)      Functions: 60% (3 / 5)      Lines: 48.84% (21 / 43)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/node_modules/object-assign/
File Statements Branches Functions Lines
index.js 48.84% (21 / 43) 25% (5 / 20) 60% (3 / 5) 48.84% (21 / 43)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/node_modules/object-assign/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/configstore/node_modules/object-assign/index.js

Statements: 48.84% (21 / 43)      Branches: 25% (5 / 20)      Functions: 60% (3 / 5)      Lines: 48.84% (21 / 43)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85    1 1   1               1 1 1             1 1 1         1 1 10   1 10   1         1 1 20   1         1             1                                                      
'use strict';
/* eslint-disable no-unused-vars */
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
 
function toObject(val) {
	if (val === null || val === undefined) {
		throw new TypeError('Object.assign cannot be called with null or undefined');
	}
 
	return Object(val);
}
 
function shouldUseNative() {
	try {
		Iif (!Object.assign) {
			return false;
		}
 
		// Detect buggy property enumeration order in older V8 versions.
 
		// https://bugs.chromium.org/p/v8/issues/detail?id=4118
		var test1 = new String('abc');  // eslint-disable-line
		test1[5] = 'de';
		Iif (Object.getOwnPropertyNames(test1)[0] === '5') {
			return false;
		}
 
		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test2 = {};
		for (var i = 0; i < 10; i++) {
			test2['_' + String.fromCharCode(i)] = i;
		}
		var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
			return test2[n];
		});
		Iif (order2.join('') !== '0123456789') {
			return false;
		}
 
		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test3 = {};
		'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
			test3[letter] = letter;
		});
		Iif (Object.keys(Object.assign({}, test3)).join('') !==
				'abcdefghijklmnopqrst') {
			return false;
		}
 
		return true;
	} catch (e) {
		// We don't expect any of the above to throw, but better to be safe.
		return false;
	}
}
 
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
	var from;
	var to = toObject(target);
	var symbols;
 
	for (var s = 1; s < arguments.length; s++) {
		from = Object(arguments[s]);
 
		for (var key in from) {
			if (hasOwnProperty.call(from, key)) {
				to[key] = from[key];
			}
		}
 
		if (Object.getOwnPropertySymbols) {
			symbols = Object.getOwnPropertySymbols(from);
			for (var i = 0; i < symbols.length; i++) {
				if (propIsEnumerable.call(from, symbols[i])) {
					to[symbols[i]] = from[symbols[i]];
				}
			}
		}
	}
 
	return to;
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/dot-prop/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/dot-prop/

Statements: 10.91% (6 / 55)      Branches: 0% (0 / 38)      Functions: 0% (0 / 5)      Lines: 10.91% (6 / 55)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/dot-prop/
File Statements Branches Functions Lines
index.js 10.91% (6 / 55) 0% (0 / 38) 0% (0 / 5) 10.91% (6 / 55)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/dot-prop/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/dot-prop/index.js

Statements: 10.91% (6 / 55)      Branches: 0% (0 / 38)      Functions: 0% (0 / 5)      Lines: 10.91% (6 / 55)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113  1   1                                                               1                                           1                                     1                                   1                                    
'use strict';
var isObj = require('is-obj');
 
module.exports.get = function (obj, path) {
	if (!isObj(obj) || typeof path !== 'string') {
		return obj;
	}
 
	var pathArr = getPathSegments(path);
 
	for (var i = 0; i < pathArr.length; i++) {
		var descriptor = Object.getOwnPropertyDescriptor(obj, pathArr[i]) || Object.getOwnPropertyDescriptor(Object.prototype, pathArr[i]);
		if (descriptor && !descriptor.enumerable) {
			return;
		}
 
		obj = obj[pathArr[i]];
 
		if (obj === undefined || obj === null) {
			// `obj` is either `undefined` or `null` so we want to stop the loop, and
			// if this is not the last bit of the path, and
			// if it did't return `undefined`
			// it would return `null` if `obj` is `null`
			// but we want `get({foo: null}, 'foo.bar')` to equal `undefined` not `null`
			if (i !== pathArr.length - 1) {
				return undefined;
			}
 
			break;
		}
	}
 
	return obj;
};
 
module.exports.set = function (obj, path, value) {
	if (!isObj(obj) || typeof path !== 'string') {
		return;
	}
 
	var pathArr = getPathSegments(path);
 
	for (var i = 0; i < pathArr.length; i++) {
		var p = pathArr[i];
 
		if (!isObj(obj[p])) {
			obj[p] = {};
		}
 
		if (i === pathArr.length - 1) {
			obj[p] = value;
		}
 
		obj = obj[p];
	}
};
 
module.exports.delete = function (obj, path) {
	if (!isObj(obj) || typeof path !== 'string') {
		return;
	}
 
	var pathArr = getPathSegments(path);
 
	for (var i = 0; i < pathArr.length; i++) {
		var p = pathArr[i];
 
		if (i === pathArr.length - 1) {
			delete obj[p];
			return;
		}
 
		obj = obj[p];
	}
};
 
module.exports.has = function (obj, path) {
	if (!isObj(obj) || typeof path !== 'string') {
		return false;
	}
 
	var pathArr = getPathSegments(path);
 
	for (var i = 0; i < pathArr.length; i++) {
		obj = obj[pathArr[i]];
 
		if (obj === undefined) {
			return false;
		}
	}
 
	return true;
};
 
function getPathSegments(path) {
	var pathArr = path.split('.');
	var parts = [];
 
	for (var i = 0; i < pathArr.length; i++) {
		var p = pathArr[i];
 
		while (p[p.length - 1] === '\\' && pathArr[i + 1] !== undefined) {
			p = p.slice(0, -1) + '.';
			p += pathArr[++i];
		}
 
		parts.push(p);
	}
 
	return parts;
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/lib/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/lib/

Statements: 89.47% (17 / 19)      Branches: 62.5% (5 / 8)      Functions: 75% (3 / 4)      Lines: 88.89% (16 / 18)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/lib/
File Statements Branches Functions Lines
findup-sync.js 89.47% (17 / 19) 62.5% (5 / 8) 75% (3 / 4) 88.89% (16 / 18)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/lib/findup-sync.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/lib/findup-sync.js

Statements: 89.47% (17 / 19)      Branches: 62.5% (5 / 8)      Functions: 75% (3 / 4)      Lines: 88.89% (16 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51                      1     1     1   1     1 1 1   1 1   2 2       1     2 1     1 1                
/*
 * findup-sync
 * https://github.com/cowboy/node-findup-sync
 *
 * Copyright (c) 2013 "Cowboy" Ben Alman
 * Licensed under the MIT license.
 */
 
'use strict';
 
// Nodejs libs.
var path = require('path');
 
// External libs.
var glob = require('glob');
 
// Search for a filename in the given directory or all parent directories.
module.exports = function(patterns, options) {
  // Normalize patterns to an array.
  Eif (!Array.isArray(patterns)) { patterns = [patterns]; }
  // Create globOptions so that it can be modified without mutating the
  // original object.
  var globOptions = Object.create(options || {});
  globOptions.maxDepth = 1;
  globOptions.cwd = path.resolve(globOptions.cwd || '.');
 
  var files, lastpath;
  do {
    // Search for files matching patterns.
    files = patterns.map(function(pattern) {
      return glob.sync(pattern, globOptions);
    }).reduce(function(a, b) {
      return a.concat(b);
    }).filter(function(entry, index, arr) {
      return index === arr.indexOf(entry);
    });
    // Return file if found.
    if (files.length > 0) {
      return path.resolve(path.join(globOptions.cwd, files[0]));
    }
    // Go up a directory.
    lastpath = globOptions.cwd;
    globOptions.cwd = path.resolve(globOptions.cwd, '..');
  // If parentpath is the same as basedir, we can't go any higher.
  } while (globOptions.cwd !== lastpath);
 
  // No files were found!
  return null;
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/

Statements: 27.64% (228 / 825)      Branches: 13.62% (73 / 536)      Functions: 19.72% (14 / 71)      Lines: 27.7% (228 / 823)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/
File Statements Branches Functions Lines
common.js 59.74% (92 / 154) 41.51% (44 / 106) 41.18% (7 / 17) 59.74% (92 / 154)
glob.js 13.25% (55 / 415) 0% (0 / 260) 0% (0 / 38) 13.32% (55 / 413)
sync.js 31.64% (81 / 256) 17.06% (29 / 170) 43.75% (7 / 16) 31.64% (81 / 256)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/common.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/common.js

Statements: 59.74% (92 / 154)      Branches: 41.51% (44 / 106)      Functions: 41.18% (7 / 17)      Lines: 59.74% (92 / 154)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 2471 1 1 1 1 1 1 1 1   1 4     1 1 1 1   1       1       1 2   2     2         1                         1 2       2             2 2 2 2 2 2 2 2 2 2   2 2 2 2 2 2 2   2 2 2 2   2   2 2 2     2 2     2 2 2     2       2 2 2   2 2         1 1 2                             1 2 2   2 2 2 1                   1 1     1 1         2 2   2 2     2                     2         2     1                                               1 2 2   2   2 2       2           1                 1                  
exports.alphasort = alphasort
exports.alphasorti = alphasorti
exports.setopts = setopts
exports.ownProp = ownProp
exports.makeAbs = makeAbs
exports.finish = finish
exports.mark = mark
exports.isIgnored = isIgnored
exports.childrenIgnored = childrenIgnored
 
function ownProp (obj, field) {
  return Object.prototype.hasOwnProperty.call(obj, field)
}
 
var path = require("path")
var minimatch = require("minimatch")
var isAbsolute = require("path-is-absolute")
var Minimatch = minimatch.Minimatch
 
function alphasorti (a, b) {
  return a.toLowerCase().localeCompare(b.toLowerCase())
}
 
function alphasort (a, b) {
  return a.localeCompare(b)
}
 
function setupIgnores (self, options) {
  self.ignore = options.ignore || []
 
  Iif (!Array.isArray(self.ignore))
    self.ignore = [self.ignore]
 
  Iif (self.ignore.length) {
    self.ignore = self.ignore.map(ignoreMap)
  }
}
 
function ignoreMap (pattern) {
  var gmatcher = null
  if (pattern.slice(-3) === '/**') {
    var gpattern = pattern.replace(/(\/\*\*)+$/, '')
    gmatcher = new Minimatch(gpattern)
  }
 
  return {
    matcher: new Minimatch(pattern),
    gmatcher: gmatcher
  }
}
 
function setopts (self, pattern, options) {
  Iif (!options)
    options = {}
 
  // base-matching: just use globstar for that.
  Iif (options.matchBase && -1 === pattern.indexOf("/")) {
    if (options.noglobstar) {
      throw new Error("base matching requires globstar")
    }
    pattern = "**/" + pattern
  }
 
  self.silent = !!options.silent
  self.pattern = pattern
  self.strict = options.strict !== false
  self.realpath = !!options.realpath
  self.realpathCache = options.realpathCache || Object.create(null)
  self.follow = !!options.follow
  self.dot = !!options.dot
  self.mark = !!options.mark
  self.nodir = !!options.nodir
  Iif (self.nodir)
    self.mark = true
  self.sync = !!options.sync
  self.nounique = !!options.nounique
  self.nonull = !!options.nonull
  self.nosort = !!options.nosort
  self.nocase = !!options.nocase
  self.stat = !!options.stat
  self.noprocess = !!options.noprocess
 
  self.maxLength = options.maxLength || Infinity
  self.cache = options.cache || Object.create(null)
  self.statCache = options.statCache || Object.create(null)
  self.symlinks = options.symlinks || Object.create(null)
 
  setupIgnores(self, options)
 
  self.changedCwd = false
  var cwd = process.cwd()
  Iif (!ownProp(options, "cwd"))
    self.cwd = cwd
  else {
    self.cwd = options.cwd
    self.changedCwd = path.resolve(options.cwd) !== cwd
  }
 
  self.root = options.root || path.resolve(self.cwd, "/")
  self.root = path.resolve(self.root)
  Iif (process.platform === "win32")
    self.root = self.root.replace(/\\/g, "/")
 
  self.nomount = !!options.nomount
 
  // disable comments and negation unless the user explicitly
  // passes in false as the option.
  options.nonegate = options.nonegate === false ? false : true
  options.nocomment = options.nocomment === false ? false : true
  deprecationWarning(options)
 
  self.minimatch = new Minimatch(pattern, options)
  self.options = self.minimatch.options
}
 
// TODO(isaacs): remove entirely in v6
// exported to reset in tests
exports.deprecationWarned
function deprecationWarning(options) {
  Iif (!options.nonegate || !options.nocomment) {
    if (process.noDeprecation !== true && !exports.deprecationWarned) {
      var msg = 'glob WARNING: comments and negation will be disabled in v6'
      if (process.throwDeprecation)
        throw new Error(msg)
      else if (process.traceDeprecation)
        console.trace(msg)
      else
        console.error(msg)
 
      exports.deprecationWarned = true
    }
  }
}
 
function finish (self) {
  var nou = self.nounique
  var all = nou ? [] : Object.create(null)
 
  for (var i = 0, l = self.matches.length; i < l; i ++) {
    var matches = self.matches[i]
    if (!matches || Object.keys(matches).length === 0) {
      Iif (self.nonull) {
        // do like the shell, and spit out the literal glob
        var literal = self.minimatch.globSet[i]
        if (nou)
          all.push(literal)
        else
          all[literal] = true
      }
    } else {
      // had matches
      var m = Object.keys(matches)
      Iif (nou)
        all.push.apply(all, m)
      else
        m.forEach(function (m) {
          all[m] = true
        })
    }
  }
 
  Eif (!nou)
    all = Object.keys(all)
 
  Eif (!self.nosort)
    all = all.sort(self.nocase ? alphasorti : alphasort)
 
  // at *some* point we statted all of these
  Iif (self.mark) {
    for (var i = 0; i < all.length; i++) {
      all[i] = self._mark(all[i])
    }
    if (self.nodir) {
      all = all.filter(function (e) {
        return !(/\/$/.test(e))
      })
    }
  }
 
  Iif (self.ignore.length)
    all = all.filter(function(m) {
      return !isIgnored(self, m)
    })
 
  self.found = all
}
 
function mark (self, p) {
  var abs = makeAbs(self, p)
  var c = self.cache[abs]
  var m = p
  if (c) {
    var isDir = c === 'DIR' || Array.isArray(c)
    var slash = p.slice(-1) === '/'
 
    if (isDir && !slash)
      m += '/'
    else if (!isDir && slash)
      m = m.slice(0, -1)
 
    if (m !== p) {
      var mabs = makeAbs(self, m)
      self.statCache[mabs] = self.statCache[abs]
      self.cache[mabs] = self.cache[abs]
    }
  }
 
  return m
}
 
// lotta situps...
function makeAbs (self, f) {
  var abs = f
  Iif (f.charAt(0) === '/') {
    abs = path.join(self.root, f)
  } else Iif (isAbsolute(f) || f === '') {
    abs = f
  } else Eif (self.changedCwd) {
    abs = path.resolve(self.cwd, f)
  } else {
    abs = path.resolve(f)
  }
  return abs
}
 
 
// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
function isIgnored (self, path) {
  if (!self.ignore.length)
    return false
 
  return self.ignore.some(function(item) {
    return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
  })
}
 
function childrenIgnored (self, path) {
  if (!self.ignore.length)
    return false
 
  return self.ignore.some(function(item) {
    return !!(item.gmatcher && item.gmatcher.match(path))
  })
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/glob.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/glob.js

Statements: 13.25% (55 / 415)      Branches: 0% (0 / 260)      Functions: 0% (0 / 38)      Lines: 13.32% (55 / 413)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754                                                                                1   1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1   1   1                         1 1     1   1                                 1 1 1                                                                                                           1             1                       1                           1           1                                                                   1       1       1         1             1                                               1                                                                                                                                           1             1                                                                                                                                                             1                                                                     1                               1                                 1                                                 1                 1                                           1                                                                   1               1                                                                               1               1                                                             1                                                                                     1                               1                                          
// Approach:
//
// 1. Get the minimatch set
// 2. For each pattern in the set, PROCESS(pattern, false)
// 3. Store matches per-set, then uniq them
//
// PROCESS(pattern, inGlobStar)
// Get the first [n] items from pattern that are all strings
// Join these together.  This is PREFIX.
//   If there is no more remaining, then stat(PREFIX) and
//   add to matches if it succeeds.  END.
//
// If inGlobStar and PREFIX is symlink and points to dir
//   set ENTRIES = []
// else readdir(PREFIX) as ENTRIES
//   If fail, END
//
// with ENTRIES
//   If pattern[n] is GLOBSTAR
//     // handle the case where the globstar match is empty
//     // by pruning it out, and testing the resulting pattern
//     PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
//     // handle other cases.
//     for ENTRY in ENTRIES (not dotfiles)
//       // attach globstar + tail onto the entry
//       // Mark that this entry is a globstar match
//       PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
//
//   else // not globstar
//     for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
//       Test ENTRY against pattern[n]
//       If fails, continue
//       If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
//
// Caveat:
//   Cache all stats and readdirs results to minimize syscall.  Since all
//   we ever care about is existence and directory-ness, we can just keep
//   `true` for files, and [children,...] for directories, or `false` for
//   things that don't exist.
 
module.exports = glob
 
var fs = require('fs')
var minimatch = require('minimatch')
var Minimatch = minimatch.Minimatch
var inherits = require('inherits')
var EE = require('events').EventEmitter
var path = require('path')
var assert = require('assert')
var isAbsolute = require('path-is-absolute')
var globSync = require('./sync.js')
var common = require('./common.js')
var alphasort = common.alphasort
var alphasorti = common.alphasorti
var setopts = common.setopts
var ownProp = common.ownProp
var inflight = require('inflight')
var util = require('util')
var childrenIgnored = common.childrenIgnored
var isIgnored = common.isIgnored
 
var once = require('once')
 
function glob (pattern, options, cb) {
  if (typeof options === 'function') cb = options, options = {}
  if (!options) options = {}
 
  if (options.sync) {
    if (cb)
      throw new TypeError('callback provided to sync glob')
    return globSync(pattern, options)
  }
 
  return new Glob(pattern, options, cb)
}
 
glob.sync = globSync
var GlobSync = glob.GlobSync = globSync.GlobSync
 
// old api surface
glob.glob = glob
 
glob.hasMagic = function (pattern, options_) {
  var options = util._extend({}, options_)
  options.noprocess = true
 
  var g = new Glob(pattern, options)
  var set = g.minimatch.set
  if (set.length > 1)
    return true
 
  for (var j = 0; j < set[0].length; j++) {
    if (typeof set[0][j] !== 'string')
      return true
  }
 
  return false
}
 
glob.Glob = Glob
inherits(Glob, EE)
function Glob (pattern, options, cb) {
  if (typeof options === 'function') {
    cb = options
    options = null
  }
 
  if (options && options.sync) {
    if (cb)
      throw new TypeError('callback provided to sync glob')
    return new GlobSync(pattern, options)
  }
 
  if (!(this instanceof Glob))
    return new Glob(pattern, options, cb)
 
  setopts(this, pattern, options)
  this._didRealPath = false
 
  // process each pattern in the minimatch set
  var n = this.minimatch.set.length
 
  // The matches are stored as {<filename>: true,...} so that
  // duplicates are automagically pruned.
  // Later, we do an Object.keys() on these.
  // Keep them as a list so we can fill in when nonull is set.
  this.matches = new Array(n)
 
  if (typeof cb === 'function') {
    cb = once(cb)
    this.on('error', cb)
    this.on('end', function (matches) {
      cb(null, matches)
    })
  }
 
  var self = this
  var n = this.minimatch.set.length
  this._processing = 0
  this.matches = new Array(n)
 
  this._emitQueue = []
  this._processQueue = []
  this.paused = false
 
  if (this.noprocess)
    return this
 
  if (n === 0)
    return done()
 
  for (var i = 0; i < n; i ++) {
    this._process(this.minimatch.set[i], i, false, done)
  }
 
  function done () {
    --self._processing
    if (self._processing <= 0)
      self._finish()
  }
}
 
Glob.prototype._finish = function () {
  assert(this instanceof Glob)
  if (this.aborted)
    return
 
  if (this.realpath && !this._didRealpath)
    return this._realpath()
 
  common.finish(this)
  this.emit('end', this.found)
}
 
Glob.prototype._realpath = function () {
  if (this._didRealpath)
    return
 
  this._didRealpath = true
 
  var n = this.matches.length
  if (n === 0)
    return this._finish()
 
  var self = this
  for (var i = 0; i < this.matches.length; i++)
    this._realpathSet(i, next)
 
  function next () {
    if (--n === 0)
      self._finish()
  }
}
 
Glob.prototype._realpathSet = function (index, cb) {
  var matchset = this.matches[index]
  if (!matchset)
    return cb()
 
  var found = Object.keys(matchset)
  var self = this
  var n = found.length
 
  if (n === 0)
    return cb()
 
  var set = this.matches[index] = Object.create(null)
  found.forEach(function (p, i) {
    // If there's a problem with the stat, then it means that
    // one or more of the links in the realpath couldn't be
    // resolved.  just return the abs value in that case.
    p = self._makeAbs(p)
    fs.realpath(p, self.realpathCache, function (er, real) {
      if (!er)
        set[real] = true
      else if (er.syscall === 'stat')
        set[p] = true
      else
        self.emit('error', er) // srsly wtf right here
 
      if (--n === 0) {
        self.matches[index] = set
        cb()
      }
    })
  })
}
 
Glob.prototype._mark = function (p) {
  return common.mark(this, p)
}
 
Glob.prototype._makeAbs = function (f) {
  return common.makeAbs(this, f)
}
 
Glob.prototype.abort = function () {
  this.aborted = true
  this.emit('abort')
}
 
Glob.prototype.pause = function () {
  if (!this.paused) {
    this.paused = true
    this.emit('pause')
  }
}
 
Glob.prototype.resume = function () {
  if (this.paused) {
    this.emit('resume')
    this.paused = false
    if (this._emitQueue.length) {
      var eq = this._emitQueue.slice(0)
      this._emitQueue.length = 0
      for (var i = 0; i < eq.length; i ++) {
        var e = eq[i]
        this._emitMatch(e[0], e[1])
      }
    }
    if (this._processQueue.length) {
      var pq = this._processQueue.slice(0)
      this._processQueue.length = 0
      for (var i = 0; i < pq.length; i ++) {
        var p = pq[i]
        this._processing--
        this._process(p[0], p[1], p[2], p[3])
      }
    }
  }
}
 
Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
  assert(this instanceof Glob)
  assert(typeof cb === 'function')
 
  if (this.aborted)
    return
 
  this._processing++
  if (this.paused) {
    this._processQueue.push([pattern, index, inGlobStar, cb])
    return
  }
 
  //console.error('PROCESS %d', this._processing, pattern)
 
  // Get the first [n] parts of pattern that are all strings.
  var n = 0
  while (typeof pattern[n] === 'string') {
    n ++
  }
  // now n is the index of the first one that is *not* a string.
 
  // see if there's anything else
  var prefix
  switch (n) {
    // if not, then this is rather simple
    case pattern.length:
      this._processSimple(pattern.join('/'), index, cb)
      return
 
    case 0:
      // pattern *starts* with some non-trivial item.
      // going to readdir(cwd), but not include the prefix in matches.
      prefix = null
      break
 
    default:
      // pattern has some string bits in the front.
      // whatever it starts with, whether that's 'absolute' like /foo/bar,
      // or 'relative' like '../baz'
      prefix = pattern.slice(0, n).join('/')
      break
  }
 
  var remain = pattern.slice(n)
 
  // get the list of entries.
  var read
  if (prefix === null)
    read = '.'
  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
    if (!prefix || !isAbsolute(prefix))
      prefix = '/' + prefix
    read = prefix
  } else
    read = prefix
 
  var abs = this._makeAbs(read)
 
  //if ignored, skip _processing
  if (childrenIgnored(this, read))
    return cb()
 
  var isGlobStar = remain[0] === minimatch.GLOBSTAR
  if (isGlobStar)
    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
  else
    this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
}
 
Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  var self = this
  this._readdir(abs, inGlobStar, function (er, entries) {
    return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  })
}
 
Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
 
  // if the abs isn't a dir, then nothing can match!
  if (!entries)
    return cb()
 
  // It will only match dot entries if it starts with a dot, or if
  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
  var pn = remain[0]
  var negate = !!this.minimatch.negate
  var rawGlob = pn._glob
  var dotOk = this.dot || rawGlob.charAt(0) === '.'
 
  var matchedEntries = []
  for (var i = 0; i < entries.length; i++) {
    var e = entries[i]
    if (e.charAt(0) !== '.' || dotOk) {
      var m
      if (negate && !prefix) {
        m = !e.match(pn)
      } else {
        m = e.match(pn)
      }
      if (m)
        matchedEntries.push(e)
    }
  }
 
  //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
 
  var len = matchedEntries.length
  // If there are no matched entries, then nothing matches.
  if (len === 0)
    return cb()
 
  // if this is the last remaining pattern bit, then no need for
  // an additional stat *unless* the user has specified mark or
  // stat explicitly.  We know they exist, since readdir returned
  // them.
 
  if (remain.length === 1 && !this.mark && !this.stat) {
    if (!this.matches[index])
      this.matches[index] = Object.create(null)
 
    for (var i = 0; i < len; i ++) {
      var e = matchedEntries[i]
      if (prefix) {
        if (prefix !== '/')
          e = prefix + '/' + e
        else
          e = prefix + e
      }
 
      if (e.charAt(0) === '/' && !this.nomount) {
        e = path.join(this.root, e)
      }
      this._emitMatch(index, e)
    }
    // This was the last one, and no stats were needed
    return cb()
  }
 
  // now test all matched entries as stand-ins for that part
  // of the pattern.
  remain.shift()
  for (var i = 0; i < len; i ++) {
    var e = matchedEntries[i]
    var newPattern
    if (prefix) {
      if (prefix !== '/')
        e = prefix + '/' + e
      else
        e = prefix + e
    }
    this._process([e].concat(remain), index, inGlobStar, cb)
  }
  cb()
}
 
Glob.prototype._emitMatch = function (index, e) {
  if (this.aborted)
    return
 
  if (this.matches[index][e])
    return
 
  if (isIgnored(this, e))
    return
 
  if (this.paused) {
    this._emitQueue.push([index, e])
    return
  }
 
  var abs = this._makeAbs(e)
 
  if (this.nodir) {
    var c = this.cache[abs]
    if (c === 'DIR' || Array.isArray(c))
      return
  }
 
  if (this.mark)
    e = this._mark(e)
 
  this.matches[index][e] = true
 
  var st = this.statCache[abs]
  if (st)
    this.emit('stat', e, st)
 
  this.emit('match', e)
}
 
Glob.prototype._readdirInGlobStar = function (abs, cb) {
  if (this.aborted)
    return
 
  // follow all symlinked directories forever
  // just proceed as if this is a non-globstar situation
  if (this.follow)
    return this._readdir(abs, false, cb)
 
  var lstatkey = 'lstat\0' + abs
  var self = this
  var lstatcb = inflight(lstatkey, lstatcb_)
 
  if (lstatcb)
    fs.lstat(abs, lstatcb)
 
  function lstatcb_ (er, lstat) {
    if (er)
      return cb()
 
    var isSym = lstat.isSymbolicLink()
    self.symlinks[abs] = isSym
 
    // If it's not a symlink or a dir, then it's definitely a regular file.
    // don't bother doing a readdir in that case.
    if (!isSym && !lstat.isDirectory()) {
      self.cache[abs] = 'FILE'
      cb()
    } else
      self._readdir(abs, false, cb)
  }
}
 
Glob.prototype._readdir = function (abs, inGlobStar, cb) {
  if (this.aborted)
    return
 
  cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
  if (!cb)
    return
 
  //console.error('RD %j %j', +inGlobStar, abs)
  if (inGlobStar && !ownProp(this.symlinks, abs))
    return this._readdirInGlobStar(abs, cb)
 
  if (ownProp(this.cache, abs)) {
    var c = this.cache[abs]
    if (!c || c === 'FILE')
      return cb()
 
    if (Array.isArray(c))
      return cb(null, c)
  }
 
  var self = this
  fs.readdir(abs, readdirCb(this, abs, cb))
}
 
function readdirCb (self, abs, cb) {
  return function (er, entries) {
    if (er)
      self._readdirError(abs, er, cb)
    else
      self._readdirEntries(abs, entries, cb)
  }
}
 
Glob.prototype._readdirEntries = function (abs, entries, cb) {
  if (this.aborted)
    return
 
  // if we haven't asked to stat everything, then just
  // assume that everything in there exists, so we can avoid
  // having to stat it a second time.
  if (!this.mark && !this.stat) {
    for (var i = 0; i < entries.length; i ++) {
      var e = entries[i]
      if (abs === '/')
        e = abs + e
      else
        e = abs + '/' + e
      this.cache[e] = true
    }
  }
 
  this.cache[abs] = entries
  return cb(null, entries)
}
 
Glob.prototype._readdirError = function (f, er, cb) {
  if (this.aborted)
    return
 
  // handle errors, and cache the information
  switch (er.code) {
    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
    case 'ENOTDIR': // totally normal. means it *does* exist.
      this.cache[this._makeAbs(f)] = 'FILE'
      break
 
    case 'ENOENT': // not terribly unusual
    case 'ELOOP':
    case 'ENAMETOOLONG':
    case 'UNKNOWN':
      this.cache[this._makeAbs(f)] = false
      break
 
    default: // some unusual error.  Treat as failure.
      this.cache[this._makeAbs(f)] = false
      if (this.strict) {
        this.emit('error', er)
        // If the error is handled, then we abort
        // if not, we threw out of here
        this.abort()
      }
      if (!this.silent)
        console.error('glob error', er)
      break
  }
 
  return cb()
}
 
Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  var self = this
  this._readdir(abs, inGlobStar, function (er, entries) {
    self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  })
}
 
 
Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  //console.error('pgs2', prefix, remain[0], entries)
 
  // no entries means not a dir, so it can never have matches
  // foo.txt/** doesn't match foo.txt
  if (!entries)
    return cb()
 
  // test without the globstar, and with every child both below
  // and replacing the globstar.
  var remainWithoutGlobStar = remain.slice(1)
  var gspref = prefix ? [ prefix ] : []
  var noGlobStar = gspref.concat(remainWithoutGlobStar)
 
  // the noGlobStar pattern exits the inGlobStar state
  this._process(noGlobStar, index, false, cb)
 
  var isSym = this.symlinks[abs]
  var len = entries.length
 
  // If it's a symlink, and we're in a globstar, then stop
  if (isSym && inGlobStar)
    return cb()
 
  for (var i = 0; i < len; i++) {
    var e = entries[i]
    if (e.charAt(0) === '.' && !this.dot)
      continue
 
    // these two cases enter the inGlobStar state
    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
    this._process(instead, index, true, cb)
 
    var below = gspref.concat(entries[i], remain)
    this._process(below, index, true, cb)
  }
 
  cb()
}
 
Glob.prototype._processSimple = function (prefix, index, cb) {
  // XXX review this.  Shouldn't it be doing the mounting etc
  // before doing stat?  kinda weird?
  var self = this
  this._stat(prefix, function (er, exists) {
    self._processSimple2(prefix, index, er, exists, cb)
  })
}
Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
 
  //console.error('ps2', prefix, exists)
 
  if (!this.matches[index])
    this.matches[index] = Object.create(null)
 
  // If it doesn't exist, then just mark the lack of results
  if (!exists)
    return cb()
 
  if (prefix && isAbsolute(prefix) && !this.nomount) {
    var trail = /[\/\\]$/.test(prefix)
    if (prefix.charAt(0) === '/') {
      prefix = path.join(this.root, prefix)
    } else {
      prefix = path.resolve(this.root, prefix)
      if (trail)
        prefix += '/'
    }
  }
 
  if (process.platform === 'win32')
    prefix = prefix.replace(/\\/g, '/')
 
  // Mark this as a match
  this._emitMatch(index, prefix)
  cb()
}
 
// Returns either 'DIR', 'FILE', or false
Glob.prototype._stat = function (f, cb) {
  var abs = this._makeAbs(f)
  var needDir = f.slice(-1) === '/'
 
  if (f.length > this.maxLength)
    return cb()
 
  if (!this.stat && ownProp(this.cache, abs)) {
    var c = this.cache[abs]
 
    if (Array.isArray(c))
      c = 'DIR'
 
    // It exists, but maybe not how we need it
    if (!needDir || c === 'DIR')
      return cb(null, c)
 
    if (needDir && c === 'FILE')
      return cb()
 
    // otherwise we have to stat, because maybe c=true
    // if we know it exists, but not what it is.
  }
 
  var exists
  var stat = this.statCache[abs]
  if (stat !== undefined) {
    if (stat === false)
      return cb(null, stat)
    else {
      var type = stat.isDirectory() ? 'DIR' : 'FILE'
      if (needDir && type === 'FILE')
        return cb()
      else
        return cb(null, type, stat)
    }
  }
 
  var self = this
  var statcb = inflight('stat\0' + abs, lstatcb_)
  if (statcb)
    fs.lstat(abs, statcb)
 
  function lstatcb_ (er, lstat) {
    if (lstat && lstat.isSymbolicLink()) {
      // If it's a symlink, then treat it as the target, unless
      // the target does not exist, then treat it as a file.
      return fs.stat(abs, function (er, stat) {
        if (er)
          self._stat2(f, abs, null, lstat, cb)
        else
          self._stat2(f, abs, er, stat, cb)
      })
    } else {
      self._stat2(f, abs, er, lstat, cb)
    }
  }
}
 
Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
  if (er) {
    this.statCache[abs] = false
    return cb()
  }
 
  var needDir = f.slice(-1) === '/'
  this.statCache[abs] = stat
 
  if (abs.slice(-1) === '/' && !stat.isDirectory())
    return cb(null, false, stat)
 
  var c = stat.isDirectory() ? 'DIR' : 'FILE'
  this.cache[abs] = this.cache[abs] || c
 
  if (needDir && c !== 'DIR')
    return cb()
 
  return cb(null, c, stat)
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/sync.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/findup-sync/node_modules/glob/sync.js

Statements: 31.64% (81 / 256)      Branches: 17.06% (29 / 170)      Functions: 43.75% (7 / 16)      Lines: 31.64% (81 / 256)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 4621 1   1 1 1 1 1 1 1 1 1 1 1 1 1 1   1 2       2     1 2     2       2     2   2     2 2 2 2   2     1 2 2                                   2       1 2     2 2 2         2 2     2 2                                                                                     1                                                                                                                                                       1                                       1                                                         1                                             1                                         1                                                 1                                                                             1     2   2 2     2 1   1                     1       1       1 2 2   2     2                                 2 2 2 2 2 2   1     1             1       1   1 1   1     1     1       1 2      
module.exports = globSync
globSync.GlobSync = GlobSync
 
var fs = require('fs')
var minimatch = require('minimatch')
var Minimatch = minimatch.Minimatch
var Glob = require('./glob.js').Glob
var util = require('util')
var path = require('path')
var assert = require('assert')
var isAbsolute = require('path-is-absolute')
var common = require('./common.js')
var alphasort = common.alphasort
var alphasorti = common.alphasorti
var setopts = common.setopts
var ownProp = common.ownProp
var childrenIgnored = common.childrenIgnored
 
function globSync (pattern, options) {
  Iif (typeof options === 'function' || arguments.length === 3)
    throw new TypeError('callback provided to sync glob\n'+
                        'See: https://github.com/isaacs/node-glob/issues/167')
 
  return new GlobSync(pattern, options).found
}
 
function GlobSync (pattern, options) {
  Iif (!pattern)
    throw new Error('must provide pattern')
 
  Iif (typeof options === 'function' || arguments.length === 3)
    throw new TypeError('callback provided to sync glob\n'+
                        'See: https://github.com/isaacs/node-glob/issues/167')
 
  Iif (!(this instanceof GlobSync))
    return new GlobSync(pattern, options)
 
  setopts(this, pattern, options)
 
  Iif (this.noprocess)
    return this
 
  var n = this.minimatch.set.length
  this.matches = new Array(n)
  for (var i = 0; i < n; i ++) {
    this._process(this.minimatch.set[i], i, false)
  }
  this._finish()
}
 
GlobSync.prototype._finish = function () {
  assert(this instanceof GlobSync)
  Iif (this.realpath) {
    var self = this
    this.matches.forEach(function (matchset, index) {
      var set = self.matches[index] = Object.create(null)
      for (var p in matchset) {
        try {
          p = self._makeAbs(p)
          var real = fs.realpathSync(p, self.realpathCache)
          set[real] = true
        } catch (er) {
          if (er.syscall === 'stat')
            set[self._makeAbs(p)] = true
          else
            throw er
        }
      }
    })
  }
  common.finish(this)
}
 
 
GlobSync.prototype._process = function (pattern, index, inGlobStar) {
  assert(this instanceof GlobSync)
 
  // Get the first [n] parts of pattern that are all strings.
  var n = 0
  while (typeof pattern[n] === 'string') {
    n ++
  }
  // now n is the index of the first one that is *not* a string.
 
  // See if there's anything else
  var prefix
  switch (n) {
    // if not, then this is rather simple
    case pattern.length:
      this._processSimple(pattern.join('/'), index)
      return
 
    case 0:
      // pattern *starts* with some non-trivial item.
      // going to readdir(cwd), but not include the prefix in matches.
      prefix = null
      break
 
    default:
      // pattern has some string bits in the front.
      // whatever it starts with, whether that's 'absolute' like /foo/bar,
      // or 'relative' like '../baz'
      prefix = pattern.slice(0, n).join('/')
      break
  }
 
  var remain = pattern.slice(n)
 
  // get the list of entries.
  var read
  if (prefix === null)
    read = '.'
  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
    if (!prefix || !isAbsolute(prefix))
      prefix = '/' + prefix
    read = prefix
  } else
    read = prefix
 
  var abs = this._makeAbs(read)
 
  //if ignored, skip processing
  if (childrenIgnored(this, read))
    return
 
  var isGlobStar = remain[0] === minimatch.GLOBSTAR
  if (isGlobStar)
    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
  else
    this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
}
 
 
GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
  var entries = this._readdir(abs, inGlobStar)
 
  // if the abs isn't a dir, then nothing can match!
  if (!entries)
    return
 
  // It will only match dot entries if it starts with a dot, or if
  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
  var pn = remain[0]
  var negate = !!this.minimatch.negate
  var rawGlob = pn._glob
  var dotOk = this.dot || rawGlob.charAt(0) === '.'
 
  var matchedEntries = []
  for (var i = 0; i < entries.length; i++) {
    var e = entries[i]
    if (e.charAt(0) !== '.' || dotOk) {
      var m
      if (negate && !prefix) {
        m = !e.match(pn)
      } else {
        m = e.match(pn)
      }
      if (m)
        matchedEntries.push(e)
    }
  }
 
  var len = matchedEntries.length
  // If there are no matched entries, then nothing matches.
  if (len === 0)
    return
 
  // if this is the last remaining pattern bit, then no need for
  // an additional stat *unless* the user has specified mark or
  // stat explicitly.  We know they exist, since readdir returned
  // them.
 
  if (remain.length === 1 && !this.mark && !this.stat) {
    if (!this.matches[index])
      this.matches[index] = Object.create(null)
 
    for (var i = 0; i < len; i ++) {
      var e = matchedEntries[i]
      if (prefix) {
        if (prefix.slice(-1) !== '/')
          e = prefix + '/' + e
        else
          e = prefix + e
      }
 
      if (e.charAt(0) === '/' && !this.nomount) {
        e = path.join(this.root, e)
      }
      this.matches[index][e] = true
    }
    // This was the last one, and no stats were needed
    return
  }
 
  // now test all matched entries as stand-ins for that part
  // of the pattern.
  remain.shift()
  for (var i = 0; i < len; i ++) {
    var e = matchedEntries[i]
    var newPattern
    if (prefix)
      newPattern = [prefix, e]
    else
      newPattern = [e]
    this._process(newPattern.concat(remain), index, inGlobStar)
  }
}
 
 
GlobSync.prototype._emitMatch = function (index, e) {
  var abs = this._makeAbs(e)
  if (this.mark)
    e = this._mark(e)
 
  if (this.matches[index][e])
    return
 
  if (this.nodir) {
    var c = this.cache[this._makeAbs(e)]
    if (c === 'DIR' || Array.isArray(c))
      return
  }
 
  this.matches[index][e] = true
  if (this.stat)
    this._stat(e)
}
 
 
GlobSync.prototype._readdirInGlobStar = function (abs) {
  // follow all symlinked directories forever
  // just proceed as if this is a non-globstar situation
  if (this.follow)
    return this._readdir(abs, false)
 
  var entries
  var lstat
  var stat
  try {
    lstat = fs.lstatSync(abs)
  } catch (er) {
    // lstat failed, doesn't exist
    return null
  }
 
  var isSym = lstat.isSymbolicLink()
  this.symlinks[abs] = isSym
 
  // If it's not a symlink or a dir, then it's definitely a regular file.
  // don't bother doing a readdir in that case.
  if (!isSym && !lstat.isDirectory())
    this.cache[abs] = 'FILE'
  else
    entries = this._readdir(abs, false)
 
  return entries
}
 
GlobSync.prototype._readdir = function (abs, inGlobStar) {
  var entries
 
  if (inGlobStar && !ownProp(this.symlinks, abs))
    return this._readdirInGlobStar(abs)
 
  if (ownProp(this.cache, abs)) {
    var c = this.cache[abs]
    if (!c || c === 'FILE')
      return null
 
    if (Array.isArray(c))
      return c
  }
 
  try {
    return this._readdirEntries(abs, fs.readdirSync(abs))
  } catch (er) {
    this._readdirError(abs, er)
    return null
  }
}
 
GlobSync.prototype._readdirEntries = function (abs, entries) {
  // if we haven't asked to stat everything, then just
  // assume that everything in there exists, so we can avoid
  // having to stat it a second time.
  if (!this.mark && !this.stat) {
    for (var i = 0; i < entries.length; i ++) {
      var e = entries[i]
      if (abs === '/')
        e = abs + e
      else
        e = abs + '/' + e
      this.cache[e] = true
    }
  }
 
  this.cache[abs] = entries
 
  // mark and cache dir-ness
  return entries
}
 
GlobSync.prototype._readdirError = function (f, er) {
  // handle errors, and cache the information
  switch (er.code) {
    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
    case 'ENOTDIR': // totally normal. means it *does* exist.
      this.cache[this._makeAbs(f)] = 'FILE'
      break
 
    case 'ENOENT': // not terribly unusual
    case 'ELOOP':
    case 'ENAMETOOLONG':
    case 'UNKNOWN':
      this.cache[this._makeAbs(f)] = false
      break
 
    default: // some unusual error.  Treat as failure.
      this.cache[this._makeAbs(f)] = false
      if (this.strict)
        throw er
      if (!this.silent)
        console.error('glob error', er)
      break
  }
}
 
GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
 
  var entries = this._readdir(abs, inGlobStar)
 
  // no entries means not a dir, so it can never have matches
  // foo.txt/** doesn't match foo.txt
  if (!entries)
    return
 
  // test without the globstar, and with every child both below
  // and replacing the globstar.
  var remainWithoutGlobStar = remain.slice(1)
  var gspref = prefix ? [ prefix ] : []
  var noGlobStar = gspref.concat(remainWithoutGlobStar)
 
  // the noGlobStar pattern exits the inGlobStar state
  this._process(noGlobStar, index, false)
 
  var len = entries.length
  var isSym = this.symlinks[abs]
 
  // If it's a symlink, and we're in a globstar, then stop
  if (isSym && inGlobStar)
    return
 
  for (var i = 0; i < len; i++) {
    var e = entries[i]
    if (e.charAt(0) === '.' && !this.dot)
      continue
 
    // these two cases enter the inGlobStar state
    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
    this._process(instead, index, true)
 
    var below = gspref.concat(entries[i], remain)
    this._process(below, index, true)
  }
}
 
GlobSync.prototype._processSimple = function (prefix, index) {
  // XXX review this.  Shouldn't it be doing the mounting etc
  // before doing stat?  kinda weird?
  var exists = this._stat(prefix)
 
  Eif (!this.matches[index])
    this.matches[index] = Object.create(null)
 
  // If it doesn't exist, then just mark the lack of results
  if (!exists)
    return
 
  Iif (prefix && isAbsolute(prefix) && !this.nomount) {
    var trail = /[\/\\]$/.test(prefix)
    if (prefix.charAt(0) === '/') {
      prefix = path.join(this.root, prefix)
    } else {
      prefix = path.resolve(this.root, prefix)
      if (trail)
        prefix += '/'
    }
  }
 
  Iif (process.platform === 'win32')
    prefix = prefix.replace(/\\/g, '/')
 
  // Mark this as a match
  this.matches[index][prefix] = true
}
 
// Returns either 'DIR', 'FILE', or false
GlobSync.prototype._stat = function (f) {
  var abs = this._makeAbs(f)
  var needDir = f.slice(-1) === '/'
 
  Iif (f.length > this.maxLength)
    return false
 
  Iif (!this.stat && ownProp(this.cache, abs)) {
    var c = this.cache[abs]
 
    if (Array.isArray(c))
      c = 'DIR'
 
    // It exists, but maybe not how we need it
    if (!needDir || c === 'DIR')
      return c
 
    if (needDir && c === 'FILE')
      return false
 
    // otherwise we have to stat, because maybe c=true
    // if we know it exists, but not what it is.
  }
 
  var exists
  var stat = this.statCache[abs]
  Eif (!stat) {
    var lstat
    try {
      lstat = fs.lstatSync(abs)
    } catch (er) {
      return false
    }
 
    Iif (lstat.isSymbolicLink()) {
      try {
        stat = fs.statSync(abs)
      } catch (er) {
        stat = lstat
      }
    } else {
      stat = lstat
    }
  }
 
  this.statCache[abs] = stat
 
  var c = stat.isDirectory() ? 'DIR' : 'FILE'
  this.cache[abs] = this.cache[abs] || c
 
  Iif (needDir && c !== 'DIR')
    return false
 
  return c
}
 
GlobSync.prototype._mark = function (p) {
  return common.mark(this, p)
}
 
GlobSync.prototype._makeAbs = function (f) {
  return common.makeAbs(this, f)
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/

Statements: 36.61% (164 / 448)      Branches: 14.22% (33 / 232)      Functions: 24.14% (21 / 87)      Lines: 38.07% (158 / 415)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/
File Statements Branches Functions Lines
fs.js 81.82% (9 / 11) 66.67% (4 / 6) 100% (2 / 2) 81.82% (9 / 11)
graceful-fs.js 41.72% (68 / 163) 9.88% (8 / 81) 14.71% (5 / 34) 41.72% (68 / 163)
legacy-streams.js 6.85% (5 / 73) 0% (0 / 32) 0% (0 / 5) 7.14% (5 / 70)
polyfills.js 40.8% (82 / 201) 18.58% (21 / 113) 30.43% (14 / 46) 44.44% (76 / 171)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/fs.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/fs.js

Statements: 81.82% (9 / 11)      Branches: 66.67% (4 / 6)      Functions: 100% (2 / 2)      Lines: 81.82% (9 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23    1   1   1 1     1 1       1 82     1      
'use strict'
 
var fs = require('fs')
 
module.exports = clone(fs)
 
function clone (obj) {
  Iif (obj === null || typeof obj !== 'object')
    return obj
 
  Eif (obj instanceof Object)
    var copy = { __proto__: obj.__proto__ }
  else
    var copy = Object.create(null)
 
  Object.getOwnPropertyNames(obj).forEach(function (key) {
    Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
  })
 
  return copy
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/graceful-fs.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/graceful-fs.js

Statements: 41.72% (68 / 163)      Branches: 9.88% (8 / 81)      Functions: 14.71% (5 / 34)      Lines: 41.72% (68 / 163)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 2641 1 1 1   1   1   1 1 1               1             1 1               1 1                   1 1     121 121 121     1   1 1 1 1 1 1 1 1 1           1                         1 1 1           1                         1 1 1 1           1                         1 1 1                     1                           1       1           1 1 1   1 1 1   1 1   1             1                               1             1                         1       1       1 1 1           1                         1     1         1 121 121            
var fs = require('fs')
var polyfills = require('./polyfills.js')
var legacy = require('./legacy-streams.js')
var queue = []
 
var util = require('util')
 
function noop () {}
 
var debug = noop
Eif (util.debuglog)
  debug = util.debuglog('gfs4')
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
  debug = function() {
    var m = util.format.apply(util, arguments)
    m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
    console.error(m)
  }
 
Iif (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
  process.on('exit', function() {
    debug(queue)
    require('assert').equal(queue.length, 0)
  })
}
 
module.exports = patch(require('./fs.js'))
Iif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) {
  module.exports = patch(fs)
}
 
// Always patch fs.close/closeSync, because we want to
// retry() whenever a close happens *anywhere* in the program.
// This is essential when multiple graceful-fs instances are
// in play at the same time.
module.exports.close =
fs.close = (function (fs$close) { return function (fd, cb) {
  return fs$close.call(fs, fd, function (err) {
    if (!err)
      retry()
 
    if (typeof cb === 'function')
      cb.apply(this, arguments)
  })
}})(fs.close)
 
module.exports.closeSync =
fs.closeSync = (function (fs$closeSync) { return function (fd) {
  // Note that graceful-fs also retries when fs.closeSync() fails.
  // Looks like a bug to me, although it's probably a harmless one.
  var rval = fs$closeSync.apply(fs, arguments)
  retry()
  return rval
}})(fs.closeSync)
 
function patch (fs) {
  // Everything that references the open() function needs to be in here
  polyfills(fs)
  fs.gracefulify = patch
  fs.FileReadStream = ReadStream;  // Legacy name.
  fs.FileWriteStream = WriteStream;  // Legacy name.
  fs.createReadStream = createReadStream
  fs.createWriteStream = createWriteStream
  var fs$readFile = fs.readFile
  fs.readFile = readFile
  function readFile (path, options, cb) {
    if (typeof options === 'function')
      cb = options, options = null
 
    return go$readFile(path, options, cb)
 
    function go$readFile (path, options, cb) {
      return fs$readFile(path, options, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([go$readFile, [path, options, cb]])
        else {
          if (typeof cb === 'function')
            cb.apply(this, arguments)
          retry()
        }
      })
    }
  }
 
  var fs$writeFile = fs.writeFile
  fs.writeFile = writeFile
  function writeFile (path, data, options, cb) {
    if (typeof options === 'function')
      cb = options, options = null
 
    return go$writeFile(path, data, options, cb)
 
    function go$writeFile (path, data, options, cb) {
      return fs$writeFile(path, data, options, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([go$writeFile, [path, data, options, cb]])
        else {
          if (typeof cb === 'function')
            cb.apply(this, arguments)
          retry()
        }
      })
    }
  }
 
  var fs$appendFile = fs.appendFile
  Eif (fs$appendFile)
    fs.appendFile = appendFile
  function appendFile (path, data, options, cb) {
    if (typeof options === 'function')
      cb = options, options = null
 
    return go$appendFile(path, data, options, cb)
 
    function go$appendFile (path, data, options, cb) {
      return fs$appendFile(path, data, options, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([go$appendFile, [path, data, options, cb]])
        else {
          if (typeof cb === 'function')
            cb.apply(this, arguments)
          retry()
        }
      })
    }
  }
 
  var fs$readdir = fs.readdir
  fs.readdir = readdir
  function readdir (path, options, cb) {
    var args = [path]
    if (typeof options !== 'function') {
      args.push(options)
    } else {
      cb = options
    }
    args.push(go$readdir$cb)
 
    return go$readdir(args)
 
    function go$readdir$cb (err, files) {
      if (files && files.sort)
        files.sort()
 
      if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
        enqueue([go$readdir, [args]])
      else {
        if (typeof cb === 'function')
          cb.apply(this, arguments)
        retry()
      }
    }
  }
 
  function go$readdir (args) {
    return fs$readdir.apply(fs, args)
  }
 
  Iif (process.version.substr(0, 4) === 'v0.8') {
    var legStreams = legacy(fs)
    ReadStream = legStreams.ReadStream
    WriteStream = legStreams.WriteStream
  }
 
  var fs$ReadStream = fs.ReadStream
  ReadStream.prototype = Object.create(fs$ReadStream.prototype)
  ReadStream.prototype.open = ReadStream$open
 
  var fs$WriteStream = fs.WriteStream
  WriteStream.prototype = Object.create(fs$WriteStream.prototype)
  WriteStream.prototype.open = WriteStream$open
 
  fs.ReadStream = ReadStream
  fs.WriteStream = WriteStream
 
  function ReadStream (path, options) {
    if (this instanceof ReadStream)
      return fs$ReadStream.apply(this, arguments), this
    else
      return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
  }
 
  function ReadStream$open () {
    var that = this
    open(that.path, that.flags, that.mode, function (err, fd) {
      if (err) {
        if (that.autoClose)
          that.destroy()
 
        that.emit('error', err)
      } else {
        that.fd = fd
        that.emit('open', fd)
        that.read()
      }
    })
  }
 
  function WriteStream (path, options) {
    if (this instanceof WriteStream)
      return fs$WriteStream.apply(this, arguments), this
    else
      return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
  }
 
  function WriteStream$open () {
    var that = this
    open(that.path, that.flags, that.mode, function (err, fd) {
      if (err) {
        that.destroy()
        that.emit('error', err)
      } else {
        that.fd = fd
        that.emit('open', fd)
      }
    })
  }
 
  function createReadStream (path, options) {
    return new ReadStream(path, options)
  }
 
  function createWriteStream (path, options) {
    return new WriteStream(path, options)
  }
 
  var fs$open = fs.open
  fs.open = open
  function open (path, flags, mode, cb) {
    if (typeof mode === 'function')
      cb = mode, mode = null
 
    return go$open(path, flags, mode, cb)
 
    function go$open (path, flags, mode, cb) {
      return fs$open(path, flags, mode, function (err, fd) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([go$open, [path, flags, mode, cb]])
        else {
          if (typeof cb === 'function')
            cb.apply(this, arguments)
          retry()
        }
      })
    }
  }
 
  return fs
}
 
function enqueue (elem) {
  debug('ENQUEUE', elem[0].name, elem[1])
  queue.push(elem)
}
 
function retry () {
  var elem = queue.shift()
  Iif (elem) {
    debug('RETRY', elem[0].name, elem[1])
    elem[0].apply(null, elem[1])
  }
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/legacy-streams.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/legacy-streams.js

Statements: 6.85% (5 / 73)      Branches: 0% (0 / 32)      Functions: 0% (0 / 5)      Lines: 7.14% (5 / 70)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 1201   1   1           1                                                                                                                               1                                                                                          
var Stream = require('stream').Stream
 
module.exports = legacy
 
function legacy (fs) {
  return {
    ReadStream: ReadStream,
    WriteStream: WriteStream
  }
 
  function ReadStream (path, options) {
    if (!(this instanceof ReadStream)) return new ReadStream(path, options);
 
    Stream.call(this);
 
    var self = this;
 
    this.path = path;
    this.fd = null;
    this.readable = true;
    this.paused = false;
 
    this.flags = 'r';
    this.mode = 438; /*=0666*/
    this.bufferSize = 64 * 1024;
 
    options = options || {};
 
    // Mixin options into this
    var keys = Object.keys(options);
    for (var index = 0, length = keys.length; index < length; index++) {
      var key = keys[index];
      this[key] = options[key];
    }
 
    if (this.encoding) this.setEncoding(this.encoding);
 
    if (this.start !== undefined) {
      if ('number' !== typeof this.start) {
        throw TypeError('start must be a Number');
      }
      if (this.end === undefined) {
        this.end = Infinity;
      } else if ('number' !== typeof this.end) {
        throw TypeError('end must be a Number');
      }
 
      if (this.start > this.end) {
        throw new Error('start must be <= end');
      }
 
      this.pos = this.start;
    }
 
    if (this.fd !== null) {
      process.nextTick(function() {
        self._read();
      });
      return;
    }
 
    fs.open(this.path, this.flags, this.mode, function (err, fd) {
      if (err) {
        self.emit('error', err);
        self.readable = false;
        return;
      }
 
      self.fd = fd;
      self.emit('open', fd);
      self._read();
    })
  }
 
  function WriteStream (path, options) {
    if (!(this instanceof WriteStream)) return new WriteStream(path, options);
 
    Stream.call(this);
 
    this.path = path;
    this.fd = null;
    this.writable = true;
 
    this.flags = 'w';
    this.encoding = 'binary';
    this.mode = 438; /*=0666*/
    this.bytesWritten = 0;
 
    options = options || {};
 
    // Mixin options into this
    var keys = Object.keys(options);
    for (var index = 0, length = keys.length; index < length; index++) {
      var key = keys[index];
      this[key] = options[key];
    }
 
    if (this.start !== undefined) {
      if ('number' !== typeof this.start) {
        throw TypeError('start must be a Number');
      }
      if (this.start < 0) {
        throw new Error('start must be >= zero');
      }
 
      this.pos = this.start;
    }
 
    this.busy = false;
    this._queue = [];
 
    if (this.fd === null) {
      this._open = fs.open;
      this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
      this.flush();
    }
  }
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/polyfills.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/graceful-fs/polyfills.js

Statements: 40.8% (82 / 201)      Branches: 18.58% (21 / 113)      Functions: 30.43% (14 / 46)      Lines: 44.44% (76 / 171)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 3241 1   1 1 1 11 1 11   1 1     1 1         1   1         1           1 1               1 1 1   1 1 1   1 1 1   1 1 1   1 1 1   1 1 1     1 1     1   1 1     1                       1                                         1                             1                               1                                                                                     1 1                                                                     1 1       1 3 2               1 3 2 1 1               1 3 2               1 3 2 1 1               1 3     3                   1 3     3 1 1 1 1                               1                                
var fs = require('./fs.js')
var constants = require('constants')
 
var origCwd = process.cwd
var cwd = null
process.cwd = function() {
  if (!cwd)
    cwd = origCwd.call(process)
  return cwd
}
try {
  process.cwd()
} catch (er) {}
 
var chdir = process.chdir
process.chdir = function(d) {
  cwd = null
  chdir.call(process, d)
}
 
module.exports = patch
 
function patch (fs) {
  // (re-)implement some things that are known busted or missing.
 
  // lchmod, broken prior to 0.6.2
  // back-port the fix here.
  Iif (constants.hasOwnProperty('O_SYMLINK') &&
      process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
    patchLchmod(fs)
  }
 
  // lutimes implementation, or no-op
  Eif (!fs.lutimes) {
    patchLutimes(fs)
  }
 
  // https://github.com/isaacs/node-graceful-fs/issues/4
  // Chown should not fail on einval or eperm if non-root.
  // It should not fail on enosys ever, as this just indicates
  // that a fs doesn't support the intended operation.
 
  fs.chown = chownFix(fs.chown)
  fs.fchown = chownFix(fs.fchown)
  fs.lchown = chownFix(fs.lchown)
 
  fs.chmod = chmodFix(fs.chmod)
  fs.fchmod = chmodFix(fs.fchmod)
  fs.lchmod = chmodFix(fs.lchmod)
 
  fs.chownSync = chownFixSync(fs.chownSync)
  fs.fchownSync = chownFixSync(fs.fchownSync)
  fs.lchownSync = chownFixSync(fs.lchownSync)
 
  fs.chmodSync = chmodFixSync(fs.chmodSync)
  fs.fchmodSync = chmodFixSync(fs.fchmodSync)
  fs.lchmodSync = chmodFixSync(fs.lchmodSync)
 
  fs.stat = statFix(fs.stat)
  fs.fstat = statFix(fs.fstat)
  fs.lstat = statFix(fs.lstat)
 
  fs.statSync = statFixSync(fs.statSync)
  fs.fstatSync = statFixSync(fs.fstatSync)
  fs.lstatSync = statFixSync(fs.lstatSync)
 
  // if lchmod/lchown do not exist, then make them no-ops
  Eif (!fs.lchmod) {
    fs.lchmod = function (path, mode, cb) {
      if (cb) process.nextTick(cb)
    }
    fs.lchmodSync = function () {}
  }
  Eif (!fs.lchown) {
    fs.lchown = function (path, uid, gid, cb) {
      if (cb) process.nextTick(cb)
    }
    fs.lchownSync = function () {}
  }
 
  // on Windows, A/V software can lock the directory, causing this
  // to fail with an EACCES or EPERM if the directory contains newly
  // created files.  Try again on failure, for up to 60 seconds.
 
  // Set the timeout this long because some Windows Anti-Virus, such as Parity
  // bit9, may lock files for up to a minute, causing npm package install
  // failures. Also, take care to yield the scheduler. Windows scheduling gives
  // CPU to a busy looping process, which can cause the program causing the lock
  // contention to be starved of CPU by node, so the contention doesn't resolve.
  Iif (process.platform === "win32") {
    fs.rename = (function (fs$rename) { return function (from, to, cb) {
      var start = Date.now()
      var backoff = 0;
      fs$rename(from, to, function CB (er) {
        if (er
            && (er.code === "EACCES" || er.code === "EPERM")
            && Date.now() - start < 60000) {
          setTimeout(function() {
            fs$rename(from, to, CB);
          }, backoff)
          if (backoff < 100)
            backoff += 10;
          return;
        }
        if (cb) cb(er)
      })
    }})(fs.rename)
  }
 
  // if read() returns EAGAIN, then just try it again.
  fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) {
    var callback
    if (callback_ && typeof callback_ === 'function') {
      var eagCounter = 0
      callback = function (er, _, __) {
        if (er && er.code === 'EAGAIN' && eagCounter < 10) {
          eagCounter ++
          return fs$read.call(fs, fd, buffer, offset, length, position, callback)
        }
        callback_.apply(this, arguments)
      }
    }
    return fs$read.call(fs, fd, buffer, offset, length, position, callback)
  }})(fs.read)
 
  fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
    var eagCounter = 0
    while (true) {
      try {
        return fs$readSync.call(fs, fd, buffer, offset, length, position)
      } catch (er) {
        if (er.code === 'EAGAIN' && eagCounter < 10) {
          eagCounter ++
          continue
        }
        throw er
      }
    }
  }})(fs.readSync)
}
 
function patchLchmod (fs) {
  fs.lchmod = function (path, mode, callback) {
    fs.open( path
           , constants.O_WRONLY | constants.O_SYMLINK
           , mode
           , function (err, fd) {
      if (err) {
        if (callback) callback(err)
        return
      }
      // prefer to return the chmod error, if one occurs,
      // but still try to close, and report closing errors if they occur.
      fs.fchmod(fd, mode, function (err) {
        fs.close(fd, function(err2) {
          if (callback) callback(err || err2)
        })
      })
    })
  }
 
  fs.lchmodSync = function (path, mode) {
    var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
 
    // prefer to return the chmod error, if one occurs,
    // but still try to close, and report closing errors if they occur.
    var threw = true
    var ret
    try {
      ret = fs.fchmodSync(fd, mode)
      threw = false
    } finally {
      if (threw) {
        try {
          fs.closeSync(fd)
        } catch (er) {}
      } else {
        fs.closeSync(fd)
      }
    }
    return ret
  }
}
 
function patchLutimes (fs) {
  Iif (constants.hasOwnProperty("O_SYMLINK")) {
    fs.lutimes = function (path, at, mt, cb) {
      fs.open(path, constants.O_SYMLINK, function (er, fd) {
        if (er) {
          if (cb) cb(er)
          return
        }
        fs.futimes(fd, at, mt, function (er) {
          fs.close(fd, function (er2) {
            if (cb) cb(er || er2)
          })
        })
      })
    }
 
    fs.lutimesSync = function (path, at, mt) {
      var fd = fs.openSync(path, constants.O_SYMLINK)
      var ret
      var threw = true
      try {
        ret = fs.futimesSync(fd, at, mt)
        threw = false
      } finally {
        if (threw) {
          try {
            fs.closeSync(fd)
          } catch (er) {}
        } else {
          fs.closeSync(fd)
        }
      }
      return ret
    }
 
  } else {
    fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
    fs.lutimesSync = function () {}
  }
}
 
function chmodFix (orig) {
  if (!orig) return orig
  return function (target, mode, cb) {
    return orig.call(fs, target, mode, function (er) {
      if (chownErOk(er)) er = null
      if (cb) cb.apply(this, arguments)
    })
  }
}
 
function chmodFixSync (orig) {
  if (!orig) return orig
  return function (target, mode) {
    try {
      return orig.call(fs, target, mode)
    } catch (er) {
      if (!chownErOk(er)) throw er
    }
  }
}
 
 
function chownFix (orig) {
  if (!orig) return orig
  return function (target, uid, gid, cb) {
    return orig.call(fs, target, uid, gid, function (er) {
      if (chownErOk(er)) er = null
      if (cb) cb.apply(this, arguments)
    })
  }
}
 
function chownFixSync (orig) {
  if (!orig) return orig
  return function (target, uid, gid) {
    try {
      return orig.call(fs, target, uid, gid)
    } catch (er) {
      if (!chownErOk(er)) throw er
    }
  }
}
 
 
function statFix (orig) {
  Iif (!orig) return orig
  // Older versions of Node erroneously returned signed integers for
  // uid + gid.
  return function (target, cb) {
    return orig.call(fs, target, function (er, stats) {
      if (!stats) return cb.apply(this, arguments)
      if (stats.uid < 0) stats.uid += 0x100000000
      if (stats.gid < 0) stats.gid += 0x100000000
      if (cb) cb.apply(this, arguments)
    })
  }
}
 
function statFixSync (orig) {
  Iif (!orig) return orig
  // Older versions of Node erroneously returned signed integers for
  // uid + gid.
  return function (target) {
    var stats = orig.call(fs, target)
    Iif (stats.uid < 0) stats.uid += 0x100000000
    Iif (stats.gid < 0) stats.gid += 0x100000000
    return stats;
  }
}
 
// ENOSYS means that the fs doesn't support the op. Just ignore
// that, because it doesn't matter.
//
// if there's no getuid, or if getuid() is something other
// than 0, and the error is EINVAL or EPERM, then just ignore
// it.
//
// This specific case is a silent failure in cp, install, tar,
// and most other unix tools that manage permissions.
//
// When running as root, or if other types of errors are
// encountered, then it's strict.
function chownErOk (er) {
  if (!er)
    return true
 
  if (er.code === "ENOSYS")
    return true
 
  var nonroot = !process.getuid || process.getuid() !== 0
  if (nonroot) {
    if (er.code === "EINVAL" || er.code === "EPERM")
      return true
  }
 
  return false
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/imurmurhash/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/imurmurhash/

Statements: 91.3% (63 / 69)      Branches: 68.57% (24 / 35)      Functions: 100% (5 / 5)      Lines: 91.3% (63 / 69)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/imurmurhash/
File Statements Branches Functions Lines
imurmurhash.js 91.3% (63 / 69) 68.57% (24 / 35) 100% (5 / 5) 91.3% (63 / 69)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/imurmurhash/imurmurhash.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/imurmurhash/imurmurhash.js

Statements: 91.3% (63 / 69)      Branches: 68.57% (24 / 35)      Functions: 100% (5 / 5)      Lines: 91.3% (63 / 69)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140                      1 1               1 2 2 2       2                 1 3   3 3   3 3 3 3 3 3   3 3     3 3 3 2 2 28 28 28   28 28 28   28 2     26     26 26       2 2           2     3 3           1 1   1 1   1 1 1 1 1     1   1 1 1 1 1   1           1 2 2 2         1   1 1            
/**
 * @preserve
 * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
 *
 * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
 * @see http://github.com/homebrewing/brauhaus-diff
 * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
 * @see http://github.com/garycourt/murmurhash-js
 * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
 * @see http://sites.google.com/site/murmurhash/
 */
(function(){
    var cache;
 
    // Call this function without `new` to use the cached object (good for
    // single-threaded environments), or with `new` to create a new object.
    //
    // @param {string} key A UTF-16 or ASCII string
    // @param {number} seed An optional positive integer
    // @return {object} A MurmurHash3 object for incremental hashing
    function MurmurHash3(key, seed) {
        var m = this instanceof MurmurHash3 ? this : cache;
        m.reset(seed)
        Iif (typeof key === 'string' && key.length > 0) {
            m.hash(key);
        }
 
        Iif (m !== this) {
            return m;
        }
    };
 
    // Incrementally add a string to this hash
    //
    // @param {string} key A UTF-16 or ASCII string
    // @return {object} this
    MurmurHash3.prototype.hash = function(key) {
        var h1, k1, i, top, len;
 
        len = key.length;
        this.len += len;
 
        k1 = this.k1;
        i = 0;
        switch (this.rem) {
            case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0;
            case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0;
            case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0;
            case 3:
                k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0;
                k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0;
        }
 
        this.rem = (len + this.rem) & 3; // & 3 is same as % 4
        len -= this.rem;
        if (len > 0) {
            h1 = this.h1;
            while (1) {
                k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
                k1 = (k1 << 15) | (k1 >>> 17);
                k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;
 
                h1 ^= k1;
                h1 = (h1 << 13) | (h1 >>> 19);
                h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff;
 
                if (i >= len) {
                    break;
                }
 
                k1 = ((key.charCodeAt(i++) & 0xffff)) ^
                     ((key.charCodeAt(i++) & 0xffff) << 8) ^
                     ((key.charCodeAt(i++) & 0xffff) << 16);
                top = key.charCodeAt(i++);
                k1 ^= ((top & 0xff) << 24) ^
                      ((top & 0xff00) >> 8);
            }
 
            k1 = 0;
            switch (this.rem) {
                case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16;
                case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8;
                case 1: k1 ^= (key.charCodeAt(i) & 0xffff);
            }
 
            this.h1 = h1;
        }
 
        this.k1 = k1;
        return this;
    };
 
    // Get the result of this hash
    //
    // @return {number} The 32-bit hash
    MurmurHash3.prototype.result = function() {
        var k1, h1;
        
        k1 = this.k1;
        h1 = this.h1;
 
        Eif (k1 > 0) {
            k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
            k1 = (k1 << 15) | (k1 >>> 17);
            k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;
            h1 ^= k1;
        }
 
        h1 ^= this.len;
 
        h1 ^= h1 >>> 16;
        h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff;
        h1 ^= h1 >>> 13;
        h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff;
        h1 ^= h1 >>> 16;
 
        return h1 >>> 0;
    };
 
    // Reset the hash object for reuse
    //
    // @param {number} seed An optional positive integer
    MurmurHash3.prototype.reset = function(seed) {
        this.h1 = typeof seed === 'number' ? seed : 0;
        this.rem = this.k1 = this.len = 0;
        return this;
    };
 
    // A cached object to use. This can be safely used if you're in a single-
    // threaded environment, otherwise you need to create new hashes to use.
    cache = new MurmurHash3();
 
    Eif (typeof(module) != 'undefined') {
        module.exports = MurmurHash3;
    } else {
        this.MurmurHash3 = MurmurHash3;
    }
}());
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/inflight/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/inflight/

Statements: 24.14% (7 / 29)      Branches: 0% (0 / 4)      Functions: 0% (0 / 5)      Lines: 25% (7 / 28)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/inflight/
File Statements Branches Functions Lines
inflight.js 24.14% (7 / 29) 0% (0 / 4) 0% (0 / 5) 25% (7 / 28)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/inflight/inflight.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/inflight/inflight.js

Statements: 24.14% (7 / 29)      Branches: 0% (0 / 4)      Functions: 0% (0 / 5)      Lines: 25% (7 / 28)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 561 1 1   1   1                   1                                                             1                
var wrappy = require('wrappy')
var reqs = Object.create(null)
var once = require('once')
 
module.exports = wrappy(inflight)
 
function inflight (key, cb) {
  if (reqs[key]) {
    reqs[key].push(cb)
    return null
  } else {
    reqs[key] = [cb]
    return makeres(key)
  }
}
 
function makeres (key) {
  return once(function RES () {
    var cbs = reqs[key]
    var len = cbs.length
    var args = slice(arguments)
 
    // XXX It's somewhat ambiguous whether a new callback added in this
    // pass should be queued for later execution if something in the
    // list of callbacks throws, or if it should just be discarded.
    // However, it's such an edge case that it hardly matters, and either
    // choice is likely as surprising as the other.
    // As it happens, we do go ahead and schedule it for later execution.
    try {
      for (var i = 0; i < len; i++) {
        cbs[i].apply(null, args)
      }
    } finally {
      if (cbs.length > len) {
        // added more in the interim.
        // de-zalgo, just in case, but don't call again.
        cbs.splice(0, len)
        process.nextTick(function () {
          RES.apply(null, args)
        })
      } else {
        delete reqs[key]
      }
    }
  })
}
 
function slice (args) {
  var length = args.length
  var array = []
 
  for (var i = 0; i < length; i++) array[i] = args[i]
  return array
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/inherits/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/inherits/

Statements: 66.67% (4 / 6)      Branches: 50% (1 / 2)      Functions: 100% (0 / 0)      Lines: 80% (4 / 5)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/inherits/
File Statements Branches Functions Lines
inherits.js 66.67% (4 / 6) 50% (1 / 2) 100% (0 / 0) 80% (4 / 5)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/inherits/inherits.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/inherits/inherits.js

Statements: 66.67% (4 / 6)      Branches: 50% (1 / 2)      Functions: 100% (0 / 0)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91 1 1 1          
try {
  var util = require('util');
  Iif (typeof util.inherits !== 'function') throw '';
  module.exports = util.inherits;
} catch (e) {
  module.exports = require('./inherits_browser.js');
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/is-obj/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/is-obj/

Statements: 33.33% (1 / 3)      Branches: 0% (0 / 3)      Functions: 0% (0 / 1)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/is-obj/
File Statements Branches Functions Lines
index.js 33.33% (1 / 3) 0% (0 / 3) 0% (0 / 1) 33.33% (1 / 3)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/is-obj/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/is-obj/index.js

Statements: 33.33% (1 / 3)      Branches: 0% (0 / 3)      Functions: 0% (0 / 1)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7  1          
'use strict';
module.exports = function (x) {
	var type = typeof x;
	return x !== null && (type === 'object' || type === 'function');
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/minimatch/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/minimatch/

Statements: 30.21% (129 / 427)      Branches: 16.92% (44 / 260)      Functions: 38.24% (13 / 34)      Lines: 31.76% (128 / 403)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/minimatch/
File Statements Branches Functions Lines
minimatch.js 30.21% (129 / 427) 16.92% (44 / 260) 38.24% (13 / 34) 31.76% (128 / 403)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/minimatch/minimatch.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/minimatch/minimatch.js

Statements: 30.21% (129 / 427)      Branches: 16.92% (44 / 260)      Functions: 38.24% (13 / 34)      Lines: 31.76% (128 / 403)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 9251 1   1 1 1     1 1   1                   1     1         1       1     1     1 1 14 14         1   1 1             1                         1                               1         1                                   1 2       2       2 2     2       2 2 2 2 2 2 2     2     1   1 1   2   2 2     2       2           2     2   2   2             2 2     2     2 2     2     2 2     2   2     1 1 2 2 2 2   2                                             1       1   1 2 2 2           2     2       2     2                                 1 1 1 2       2     2 2   2 2 2   2 2 2 2 2 2     2       2   1 26                                         2     24     24           24                                                                                                                                                                                                                                                                                                               24   24     24   2     24             2                                 2                                                         2 2             2 2                     2                                                             2       2         2             2 2                                       1       1 1                                                                                         1                       1 1                                                                                                                       1                                                                                                                                                                                                                                                                                                                         1 2     1        
module.exports = minimatch
minimatch.Minimatch = Minimatch
 
var path = { sep: '/' }
try {
  path = require('path')
} catch (er) {}
 
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
var expand = require('brace-expansion')
 
var plTypes = {
  '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
  '?': { open: '(?:', close: ')?' },
  '+': { open: '(?:', close: ')+' },
  '*': { open: '(?:', close: ')*' },
  '@': { open: '(?:', close: ')' }
}
 
// any single thing other than /
// don't need to escape / when using new RegExp()
var qmark = '[^/]'
 
// * => any number of characters
var star = qmark + '*?'
 
// ** when dots are allowed.  Anything goes, except .. and .
// not (^ or / followed by one or two dots followed by $ or /),
// followed by anything, any number of times.
var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
 
// not a ^ or / followed by a dot,
// followed by anything, any number of times.
var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
 
// characters that need to be escaped in RegExp.
var reSpecials = charSet('().*{}+?[]^$\\!')
 
// "abc" -> { a:true, b:true, c:true }
function charSet (s) {
  return s.split('').reduce(function (set, c) {
    set[c] = true
    return set
  }, {})
}
 
// normalizes slashes.
var slashSplit = /\/+/
 
minimatch.filter = filter
function filter (pattern, options) {
  options = options || {}
  return function (p, i, list) {
    return minimatch(p, pattern, options)
  }
}
 
function ext (a, b) {
  a = a || {}
  b = b || {}
  var t = {}
  Object.keys(b).forEach(function (k) {
    t[k] = b[k]
  })
  Object.keys(a).forEach(function (k) {
    t[k] = a[k]
  })
  return t
}
 
minimatch.defaults = function (def) {
  if (!def || !Object.keys(def).length) return minimatch
 
  var orig = minimatch
 
  var m = function minimatch (p, pattern, options) {
    return orig.minimatch(p, pattern, ext(def, options))
  }
 
  m.Minimatch = function Minimatch (pattern, options) {
    return new orig.Minimatch(pattern, ext(def, options))
  }
 
  return m
}
 
Minimatch.defaults = function (def) {
  if (!def || !Object.keys(def).length) return Minimatch
  return minimatch.defaults(def).Minimatch
}
 
function minimatch (p, pattern, options) {
  if (typeof pattern !== 'string') {
    throw new TypeError('glob pattern string required')
  }
 
  if (!options) options = {}
 
  // shortcut: comments match nothing.
  if (!options.nocomment && pattern.charAt(0) === '#') {
    return false
  }
 
  // "" only matches ""
  if (pattern.trim() === '') return p === ''
 
  return new Minimatch(pattern, options).match(p)
}
 
function Minimatch (pattern, options) {
  Iif (!(this instanceof Minimatch)) {
    return new Minimatch(pattern, options)
  }
 
  Iif (typeof pattern !== 'string') {
    throw new TypeError('glob pattern string required')
  }
 
  Iif (!options) options = {}
  pattern = pattern.trim()
 
  // windows support: need to use /, not \
  Iif (path.sep !== '/') {
    pattern = pattern.split(path.sep).join('/')
  }
 
  this.options = options
  this.set = []
  this.pattern = pattern
  this.regexp = null
  this.negate = false
  this.comment = false
  this.empty = false
 
  // make the set of regexps etc.
  this.make()
}
 
Minimatch.prototype.debug = function () {}
 
Minimatch.prototype.make = make
function make () {
  // don't do it more than once.
  Iif (this._made) return
 
  var pattern = this.pattern
  var options = this.options
 
  // empty patterns and comments match nothing.
  Iif (!options.nocomment && pattern.charAt(0) === '#') {
    this.comment = true
    return
  }
  Iif (!pattern) {
    this.empty = true
    return
  }
 
  // step 1: figure out negation, etc.
  this.parseNegate()
 
  // step 2: expand braces
  var set = this.globSet = this.braceExpand()
 
  Iif (options.debug) this.debug = console.error
 
  this.debug(this.pattern, set)
 
  // step 3: now we have a set, so turn each one into a series of path-portion
  // matching patterns.
  // These will be regexps, except in the case of "**", which is
  // set to the GLOBSTAR object for globstar behavior,
  // and will not contain any / characters
  set = this.globParts = set.map(function (s) {
    return s.split(slashSplit)
  })
 
  this.debug(this.pattern, set)
 
  // glob --> regexps
  set = set.map(function (s, si, set) {
    return s.map(this.parse, this)
  }, this)
 
  this.debug(this.pattern, set)
 
  // filter out everything that didn't compile properly.
  set = set.filter(function (s) {
    return s.indexOf(false) === -1
  })
 
  this.debug(this.pattern, set)
 
  this.set = set
}
 
Minimatch.prototype.parseNegate = parseNegate
function parseNegate () {
  var pattern = this.pattern
  var negate = false
  var options = this.options
  var negateOffset = 0
 
  Eif (options.nonegate) return
 
  for (var i = 0, l = pattern.length
    ; i < l && pattern.charAt(i) === '!'
    ; i++) {
    negate = !negate
    negateOffset++
  }
 
  if (negateOffset) this.pattern = pattern.substr(negateOffset)
  this.negate = negate
}
 
// Brace expansion:
// a{b,c}d -> abd acd
// a{b,}c -> abc ac
// a{0..3}d -> a0d a1d a2d a3d
// a{b,c{d,e}f}g -> abg acdfg acefg
// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
//
// Invalid sets are not expanded.
// a{2..}b -> a{2..}b
// a{b}c -> a{b}c
minimatch.braceExpand = function (pattern, options) {
  return braceExpand(pattern, options)
}
 
Minimatch.prototype.braceExpand = braceExpand
 
function braceExpand (pattern, options) {
  Eif (!options) {
    Eif (this instanceof Minimatch) {
      options = this.options
    } else {
      options = {}
    }
  }
 
  pattern = typeof pattern === 'undefined'
    ? this.pattern : pattern
 
  Iif (typeof pattern === 'undefined') {
    throw new TypeError('undefined pattern')
  }
 
  Eif (options.nobrace ||
    !pattern.match(/\{.*\}/)) {
    // shortcut. no need to expand.
    return [pattern]
  }
 
  return expand(pattern)
}
 
// parse a component of the expanded set.
// At this point, no pattern may contain "/" in it
// so we're going to return a 2d array, where each entry is the full
// pattern, split on '/', and then turned into a regular expression.
// A regexp is made at the end which joins each array with an
// escaped /, and another full one which joins each regexp with |.
//
// Following the lead of Bash 4.1, note that "**" only has special meaning
// when it is the *only* thing in a path portion.  Otherwise, any series
// of * is equivalent to a single *.  Globstar behavior is enabled by
// default, and can be disabled by setting options.noglobstar.
Minimatch.prototype.parse = parse
var SUBPARSE = {}
function parse (pattern, isSub) {
  Iif (pattern.length > 1024 * 64) {
    throw new TypeError('pattern is too long')
  }
 
  var options = this.options
 
  // shortcuts
  Iif (!options.noglobstar && pattern === '**') return GLOBSTAR
  Iif (pattern === '') return ''
 
  var re = ''
  var hasMagic = !!options.nocase
  var escaping = false
  // ? => one single character
  var patternListStack = []
  var negativeLists = []
  var stateChar
  var inClass = false
  var reClassStart = -1
  var classStart = -1
  // . and .. never match anything that doesn't start with .,
  // even when options.dot is set.
  var patternStart = pattern.charAt(0) === '.' ? '' // anything
  // not (start or / followed by . or .. followed by / or end)
  : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
  : '(?!\\.)'
  var self = this
 
  function clearStateChar () {
    Iif (stateChar) {
      // we had some state-tracking character
      // that wasn't consumed by this pass.
      switch (stateChar) {
        case '*':
          re += star
          hasMagic = true
        break
        case '?':
          re += qmark
          hasMagic = true
        break
        default:
          re += '\\' + stateChar
        break
      }
      self.debug('clearStateChar %j %j', stateChar, re)
      stateChar = false
    }
  }
 
  for (var i = 0, len = pattern.length, c
    ; (i < len) && (c = pattern.charAt(i))
    ; i++) {
    this.debug('%s\t%s %s %j', pattern, i, re, c)
 
    // skip over any that are escaped.
    Iif (escaping && reSpecials[c]) {
      re += '\\' + c
      escaping = false
      continue
    }
 
    switch (c) {
      case '/':
        // completely not allowed, even escaped.
        // Should already be path-split by now.
        return false
 
      case '\\':
        clearStateChar()
        escaping = true
      continue
 
      // the various stateChar values
      // for the "extglob" stuff.
      case '?':
      case '*':
      case '+':
      case '@':
      case '!':
        this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
 
        // all of those are literals inside a class, except that
        // the glob [!a] means [^a] in regexp
        if (inClass) {
          this.debug('  in class')
          if (c === '!' && i === classStart + 1) c = '^'
          re += c
          continue
        }
 
        // if we already have a stateChar, then it means
        // that there was something like ** or +? in there.
        // Handle the stateChar, then proceed with this one.
        self.debug('call clearStateChar %j', stateChar)
        clearStateChar()
        stateChar = c
        // if extglob is disabled, then +(asdf|foo) isn't a thing.
        // just clear the statechar *now*, rather than even diving into
        // the patternList stuff.
        if (options.noext) clearStateChar()
      continue
 
      case '(':
        if (inClass) {
          re += '('
          continue
        }
 
        if (!stateChar) {
          re += '\\('
          continue
        }
 
        patternListStack.push({
          type: stateChar,
          start: i - 1,
          reStart: re.length,
          open: plTypes[stateChar].open,
          close: plTypes[stateChar].close
        })
        // negation is (?:(?!js)[^/]*)
        re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
        this.debug('plType %j %j', stateChar, re)
        stateChar = false
      continue
 
      case ')':
        if (inClass || !patternListStack.length) {
          re += '\\)'
          continue
        }
 
        clearStateChar()
        hasMagic = true
        var pl = patternListStack.pop()
        // negation is (?:(?!js)[^/]*)
        // The others are (?:<pattern>)<type>
        re += pl.close
        if (pl.type === '!') {
          negativeLists.push(pl)
        }
        pl.reEnd = re.length
      continue
 
      case '|':
        if (inClass || !patternListStack.length || escaping) {
          re += '\\|'
          escaping = false
          continue
        }
 
        clearStateChar()
        re += '|'
      continue
 
      // these are mostly the same in regexp and glob
      case '[':
        // swallow any state-tracking char before the [
        clearStateChar()
 
        if (inClass) {
          re += '\\' + c
          continue
        }
 
        inClass = true
        classStart = i
        reClassStart = re.length
        re += c
      continue
 
      case ']':
        //  a right bracket shall lose its special
        //  meaning and represent itself in
        //  a bracket expression if it occurs
        //  first in the list.  -- POSIX.2 2.8.3.2
        if (i === classStart + 1 || !inClass) {
          re += '\\' + c
          escaping = false
          continue
        }
 
        // handle the case where we left a class open.
        // "[z-a]" is valid, equivalent to "\[z-a\]"
        if (inClass) {
          // split where the last [ was, make sure we don't have
          // an invalid re. if so, re-walk the contents of the
          // would-be class to re-translate any characters that
          // were passed through as-is
          // TODO: It would probably be faster to determine this
          // without a try/catch and a new RegExp, but it's tricky
          // to do safely.  For now, this is safe and works.
          var cs = pattern.substring(classStart + 1, i)
          try {
            RegExp('[' + cs + ']')
          } catch (er) {
            // not a valid class!
            var sp = this.parse(cs, SUBPARSE)
            re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
            hasMagic = hasMagic || sp[1]
            inClass = false
            continue
          }
        }
 
        // finish up the class.
        hasMagic = true
        inClass = false
        re += c
      continue
 
      default:
        // swallow any state char that wasn't consumed
        clearStateChar()
 
        Iif (escaping) {
          // no need
          escaping = false
        } else if (reSpecials[c]
          && !(c === '^' && inClass)) {
          re += '\\'
        }
 
        re += c
 
    } // switch
  } // for
 
  // handle the case where we left a class open.
  // "[abc" is valid, equivalent to "\[abc"
  Iif (inClass) {
    // split where the last [ was, and escape it
    // this is a huge pita.  We now have to re-walk
    // the contents of the would-be class to re-translate
    // any characters that were passed through as-is
    cs = pattern.substr(classStart + 1)
    sp = this.parse(cs, SUBPARSE)
    re = re.substr(0, reClassStart) + '\\[' + sp[0]
    hasMagic = hasMagic || sp[1]
  }
 
  // handle the case where we had a +( thing at the *end*
  // of the pattern.
  // each pattern list stack adds 3 chars, and we need to go through
  // and escape any | chars that were passed through as-is for the regexp.
  // Go through and escape them, taking care not to double-escape any
  // | chars that were already escaped.
  for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
    var tail = re.slice(pl.reStart + pl.open.length)
    this.debug('setting tail', re, pl)
    // maybe some even number of \, then maybe 1 \, followed by a |
    tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
      if (!$2) {
        // the | isn't already escaped, so escape it.
        $2 = '\\'
      }
 
      // need to escape all those slashes *again*, without escaping the
      // one that we need for escaping the | character.  As it works out,
      // escaping an even number of slashes can be done by simply repeating
      // it exactly after itself.  That's why this trick works.
      //
      // I am sorry that you have to see this.
      return $1 + $1 + $2 + '|'
    })
 
    this.debug('tail=%j\n   %s', tail, tail, pl, re)
    var t = pl.type === '*' ? star
      : pl.type === '?' ? qmark
      : '\\' + pl.type
 
    hasMagic = true
    re = re.slice(0, pl.reStart) + t + '\\(' + tail
  }
 
  // handle trailing things that only matter at the very end.
  clearStateChar()
  Iif (escaping) {
    // trailing \\
    re += '\\\\'
  }
 
  // only need to apply the nodot start if the re starts with
  // something that could conceivably capture a dot
  var addPatternStart = false
  switch (re.charAt(0)) {
    case '.':
    case '[':
    case '(': addPatternStart = true
  }
 
  // Hack to work around lack of negative lookbehind in JS
  // A pattern like: *.!(x).!(y|z) needs to ensure that a name
  // like 'a.xyz.yz' doesn't match.  So, the first negative
  // lookahead, has to look ALL the way ahead, to the end of
  // the pattern.
  for (var n = negativeLists.length - 1; n > -1; n--) {
    var nl = negativeLists[n]
 
    var nlBefore = re.slice(0, nl.reStart)
    var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
    var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
    var nlAfter = re.slice(nl.reEnd)
 
    nlLast += nlAfter
 
    // Handle nested stuff like *(*.js|!(*.json)), where open parens
    // mean that we should *not* include the ) in the bit that is considered
    // "after" the negated section.
    var openParensBefore = nlBefore.split('(').length - 1
    var cleanAfter = nlAfter
    for (i = 0; i < openParensBefore; i++) {
      cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
    }
    nlAfter = cleanAfter
 
    var dollar = ''
    if (nlAfter === '' && isSub !== SUBPARSE) {
      dollar = '$'
    }
    var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
    re = newRe
  }
 
  // if the re is not "" at this point, then we need to make sure
  // it doesn't match against an empty path part.
  // Otherwise a/* will match a/, which it should not.
  Iif (re !== '' && hasMagic) {
    re = '(?=.)' + re
  }
 
  Iif (addPatternStart) {
    re = patternStart + re
  }
 
  // parsing just a piece of a larger pattern.
  Iif (isSub === SUBPARSE) {
    return [re, hasMagic]
  }
 
  // skip the regexp for non-magical patterns
  // unescape anything in it, though, so that it'll be
  // an exact match against a file etc.
  Eif (!hasMagic) {
    return globUnescape(pattern)
  }
 
  var flags = options.nocase ? 'i' : ''
  try {
    var regExp = new RegExp('^' + re + '$', flags)
  } catch (er) {
    // If it was an invalid regular expression, then it can't match
    // anything.  This trick looks for a character after the end of
    // the string, which is of course impossible, except in multi-line
    // mode, but it's not a /m regex.
    return new RegExp('$.')
  }
 
  regExp._glob = pattern
  regExp._src = re
 
  return regExp
}
 
minimatch.makeRe = function (pattern, options) {
  return new Minimatch(pattern, options || {}).makeRe()
}
 
Minimatch.prototype.makeRe = makeRe
function makeRe () {
  if (this.regexp || this.regexp === false) return this.regexp
 
  // at this point, this.set is a 2d array of partial
  // pattern strings, or "**".
  //
  // It's better to use .match().  This function shouldn't
  // be used, really, but it's pretty convenient sometimes,
  // when you just want to work with a regex.
  var set = this.set
 
  if (!set.length) {
    this.regexp = false
    return this.regexp
  }
  var options = this.options
 
  var twoStar = options.noglobstar ? star
    : options.dot ? twoStarDot
    : twoStarNoDot
  var flags = options.nocase ? 'i' : ''
 
  var re = set.map(function (pattern) {
    return pattern.map(function (p) {
      return (p === GLOBSTAR) ? twoStar
      : (typeof p === 'string') ? regExpEscape(p)
      : p._src
    }).join('\\\/')
  }).join('|')
 
  // must match entire pattern
  // ending in a * or ** will make it less strict.
  re = '^(?:' + re + ')$'
 
  // can match anything, as long as it's not this.
  if (this.negate) re = '^(?!' + re + ').*$'
 
  try {
    this.regexp = new RegExp(re, flags)
  } catch (ex) {
    this.regexp = false
  }
  return this.regexp
}
 
minimatch.match = function (list, pattern, options) {
  options = options || {}
  var mm = new Minimatch(pattern, options)
  list = list.filter(function (f) {
    return mm.match(f)
  })
  if (mm.options.nonull && !list.length) {
    list.push(pattern)
  }
  return list
}
 
Minimatch.prototype.match = match
function match (f, partial) {
  this.debug('match', f, this.pattern)
  // short-circuit in the case of busted things.
  // comments, etc.
  if (this.comment) return false
  if (this.empty) return f === ''
 
  if (f === '/' && partial) return true
 
  var options = this.options
 
  // windows: need to use /, not \
  if (path.sep !== '/') {
    f = f.split(path.sep).join('/')
  }
 
  // treat the test path as a set of pathparts.
  f = f.split(slashSplit)
  this.debug(this.pattern, 'split', f)
 
  // just ONE of the pattern sets in this.set needs to match
  // in order for it to be valid.  If negating, then just one
  // match means that we have failed.
  // Either way, return on the first hit.
 
  var set = this.set
  this.debug(this.pattern, 'set', set)
 
  // Find the basename of the path by looking for the last non-empty segment
  var filename
  var i
  for (i = f.length - 1; i >= 0; i--) {
    filename = f[i]
    if (filename) break
  }
 
  for (i = 0; i < set.length; i++) {
    var pattern = set[i]
    var file = f
    if (options.matchBase && pattern.length === 1) {
      file = [filename]
    }
    var hit = this.matchOne(file, pattern, partial)
    if (hit) {
      if (options.flipNegate) return true
      return !this.negate
    }
  }
 
  // didn't get any hits.  this is success if it's a negative
  // pattern, failure otherwise.
  if (options.flipNegate) return false
  return this.negate
}
 
// set partial to true to test if, for example,
// "/a/b" matches the start of "/*/b/*/d"
// Partial means, if you run out of file before you run
// out of pattern, then that's fine, as long as all
// the parts match.
Minimatch.prototype.matchOne = function (file, pattern, partial) {
  var options = this.options
 
  this.debug('matchOne',
    { 'this': this, file: file, pattern: pattern })
 
  this.debug('matchOne', file.length, pattern.length)
 
  for (var fi = 0,
      pi = 0,
      fl = file.length,
      pl = pattern.length
      ; (fi < fl) && (pi < pl)
      ; fi++, pi++) {
    this.debug('matchOne loop')
    var p = pattern[pi]
    var f = file[fi]
 
    this.debug(pattern, p, f)
 
    // should be impossible.
    // some invalid regexp stuff in the set.
    if (p === false) return false
 
    if (p === GLOBSTAR) {
      this.debug('GLOBSTAR', [pattern, p, f])
 
      // "**"
      // a/**/b/**/c would match the following:
      // a/b/x/y/z/c
      // a/x/y/z/b/c
      // a/b/x/b/x/c
      // a/b/c
      // To do this, take the rest of the pattern after
      // the **, and see if it would match the file remainder.
      // If so, return success.
      // If not, the ** "swallows" a segment, and try again.
      // This is recursively awful.
      //
      // a/**/b/**/c matching a/b/x/y/z/c
      // - a matches a
      // - doublestar
      //   - matchOne(b/x/y/z/c, b/**/c)
      //     - b matches b
      //     - doublestar
      //       - matchOne(x/y/z/c, c) -> no
      //       - matchOne(y/z/c, c) -> no
      //       - matchOne(z/c, c) -> no
      //       - matchOne(c, c) yes, hit
      var fr = fi
      var pr = pi + 1
      if (pr === pl) {
        this.debug('** at the end')
        // a ** at the end will just swallow the rest.
        // We have found a match.
        // however, it will not swallow /.x, unless
        // options.dot is set.
        // . and .. are *never* matched by **, for explosively
        // exponential reasons.
        for (; fi < fl; fi++) {
          if (file[fi] === '.' || file[fi] === '..' ||
            (!options.dot && file[fi].charAt(0) === '.')) return false
        }
        return true
      }
 
      // ok, let's see if we can swallow whatever we can.
      while (fr < fl) {
        var swallowee = file[fr]
 
        this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
 
        // XXX remove this slice.  Just pass the start index.
        if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
          this.debug('globstar found match!', fr, fl, swallowee)
          // found a match.
          return true
        } else {
          // can't swallow "." or ".." ever.
          // can only swallow ".foo" when explicitly asked.
          if (swallowee === '.' || swallowee === '..' ||
            (!options.dot && swallowee.charAt(0) === '.')) {
            this.debug('dot detected!', file, fr, pattern, pr)
            break
          }
 
          // ** swallows a segment, and continue.
          this.debug('globstar swallow a segment, and continue')
          fr++
        }
      }
 
      // no match was found.
      // However, in partial mode, we can't say this is necessarily over.
      // If there's more *pattern* left, then
      if (partial) {
        // ran out of file
        this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
        if (fr === fl) return true
      }
      return false
    }
 
    // something other than **
    // non-magic patterns just have to match exactly
    // patterns with magic have been turned into regexps.
    var hit
    if (typeof p === 'string') {
      if (options.nocase) {
        hit = f.toLowerCase() === p.toLowerCase()
      } else {
        hit = f === p
      }
      this.debug('string match', p, f, hit)
    } else {
      hit = f.match(p)
      this.debug('pattern match', p, f, hit)
    }
 
    if (!hit) return false
  }
 
  // Note: ending in / means that we'll get a final ""
  // at the end of the pattern.  This can only match a
  // corresponding "" at the end of the file.
  // If the file ends in /, then it can only match a
  // a pattern that ends in /, unless the pattern just
  // doesn't have any more for it. But, a/b/ should *not*
  // match "a/b/*", even though "" matches against the
  // [^/]*? pattern, except in partial mode, where it might
  // simply not be reached yet.
  // However, a/b/ should still satisfy a/*
 
  // now either we fell off the end of the pattern, or we're done.
  if (fi === fl && pi === pl) {
    // ran out of pattern and filename at the same time.
    // an exact hit!
    return true
  } else if (fi === fl) {
    // ran out of file, but still had pattern left.
    // this is ok if we're doing the match as part of
    // a glob fs traversal.
    return partial
  } else if (pi === pl) {
    // ran out of pattern, still have file left.
    // this is only acceptable if we're on the very last
    // empty segment of a file with a trailing slash.
    // a/* should match a/b/
    var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
    return emptyFileEnd
  }
 
  // should be unreachable.
  throw new Error('wtf?')
}
 
// replace stuff like \* with *
function globUnescape (s) {
  return s.replace(/\\(.)/g, '$1')
}
 
function regExpEscape (s) {
  return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/minimist/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/minimist/

Statements: 18.87% (20 / 106)      Branches: 4.44% (4 / 90)      Functions: 5.88% (1 / 17)      Lines: 19.61% (20 / 102)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/minimist/
File Statements Branches Functions Lines
index.js 18.87% (20 / 106) 4.44% (4 / 90) 5.88% (1 / 17) 19.61% (20 / 102)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/minimist/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/minimist/index.js

Statements: 18.87% (20 / 106)      Branches: 4.44% (4 / 90)      Functions: 5.88% (1 / 17)      Lines: 19.61% (20 / 102)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 1891 2   2   2       2 2                 2             2   2 2       2   2         1                     2                                                                                                                                                                       2                   2       2     1                   1                                     1              
module.exports = function (args, opts) {
    Iif (!opts) opts = {};
    
    var flags = { bools : {}, strings : {} };
    
    [].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
        flags.bools[key] = true;
    });
    
    var aliases = {};
    Object.keys(opts.alias || {}).forEach(function (key) {
        aliases[key] = [].concat(opts.alias[key]);
        aliases[key].forEach(function (x) {
            aliases[x] = [key].concat(aliases[key].filter(function (y) {
                return x !== y;
            }));
        });
    });
 
    [].concat(opts.string).filter(Boolean).forEach(function (key) {
        flags.strings[key] = true;
        if (aliases[key]) {
            flags.strings[aliases[key]] = true;
        }
     });
 
    var defaults = opts['default'] || {};
    
    var argv = { _ : [] };
    Object.keys(flags.bools).forEach(function (key) {
        setArg(key, defaults[key] === undefined ? false : defaults[key]);
    });
    
    var notFlags = [];
 
    Iif (args.indexOf('--') !== -1) {
        notFlags = args.slice(args.indexOf('--')+1);
        args = args.slice(0, args.indexOf('--'));
    }
 
    function setArg (key, val) {
        var value = !flags.strings[key] && isNumber(val)
            ? Number(val) : val
        ;
        setKey(argv, key.split('.'), value);
        
        (aliases[key] || []).forEach(function (x) {
            setKey(argv, x.split('.'), value);
        });
    }
    
    for (var i = 0; i < args.length; i++) {
        var arg = args[i];
        
        if (/^--.+=/.test(arg)) {
            // Using [\s\S] instead of . because js doesn't support the
            // 'dotall' regex modifier. See:
            // http://stackoverflow.com/a/1068308/13216
            var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
            setArg(m[1], m[2]);
        }
        else if (/^--no-.+/.test(arg)) {
            var key = arg.match(/^--no-(.+)/)[1];
            setArg(key, false);
        }
        else if (/^--.+/.test(arg)) {
            var key = arg.match(/^--(.+)/)[1];
            var next = args[i + 1];
            if (next !== undefined && !/^-/.test(next)
            && !flags.bools[key]
            && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
                setArg(key, next);
                i++;
            }
            else if (/^(true|false)$/.test(next)) {
                setArg(key, next === 'true');
                i++;
            }
            else {
                setArg(key, flags.strings[key] ? '' : true);
            }
        }
        else if (/^-[^-]+/.test(arg)) {
            var letters = arg.slice(1,-1).split('');
            
            var broken = false;
            for (var j = 0; j < letters.length; j++) {
                var next = arg.slice(j+2);
                
                if (next === '-') {
                    setArg(letters[j], next)
                    continue;
                }
                
                if (/[A-Za-z]/.test(letters[j])
                && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
                    setArg(letters[j], next);
                    broken = true;
                    break;
                }
                
                if (letters[j+1] && letters[j+1].match(/\W/)) {
                    setArg(letters[j], arg.slice(j+2));
                    broken = true;
                    break;
                }
                else {
                    setArg(letters[j], flags.strings[letters[j]] ? '' : true);
                }
            }
            
            var key = arg.slice(-1)[0];
            if (!broken && key !== '-') {
                if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
                && !flags.bools[key]
                && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
                    setArg(key, args[i+1]);
                    i++;
                }
                else if (args[i+1] && /true|false/.test(args[i+1])) {
                    setArg(key, args[i+1] === 'true');
                    i++;
                }
                else {
                    setArg(key, flags.strings[key] ? '' : true);
                }
            }
        }
        else {
            argv._.push(
                flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
            );
        }
    }
    
    Object.keys(defaults).forEach(function (key) {
        if (!hasKey(argv, key.split('.'))) {
            setKey(argv, key.split('.'), defaults[key]);
            
            (aliases[key] || []).forEach(function (x) {
                setKey(argv, x.split('.'), defaults[key]);
            });
        }
    });
    
    notFlags.forEach(function(key) {
        argv._.push(key);
    });
 
    return argv;
};
 
function hasKey (obj, keys) {
    var o = obj;
    keys.slice(0,-1).forEach(function (key) {
        o = (o[key] || {});
    });
 
    var key = keys[keys.length - 1];
    return key in o;
}
 
function setKey (obj, keys, value) {
    var o = obj;
    keys.slice(0,-1).forEach(function (key) {
        if (o[key] === undefined) o[key] = {};
        o = o[key];
    });
    
    var key = keys[keys.length - 1];
    if (o[key] === undefined || typeof o[key] === 'boolean') {
        o[key] = value;
    }
    else if (Array.isArray(o[key])) {
        o[key].push(value);
    }
    else {
        o[key] = [ o[key], value ];
    }
}
 
function isNumber (x) {
    if (typeof x === 'number') return true;
    if (/^0x[0-9a-f]+$/i.test(x)) return true;
    return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
}
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mkdirp/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mkdirp/

Statements: 38.6% (22 / 57)      Branches: 21.43% (9 / 42)      Functions: 16.67% (1 / 6)      Lines: 40.38% (21 / 52)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mkdirp/
File Statements Branches Functions Lines
index.js 38.6% (22 / 57) 21.43% (9 / 42) 16.67% (1 / 6) 40.38% (21 / 52)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mkdirp/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mkdirp/index.js

Statements: 38.6% (22 / 57)      Branches: 21.43% (9 / 42)      Functions: 16.67% (1 / 6)      Lines: 40.38% (21 / 52)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 991 1   1   1                                                                                               1 1 1     1 1   1     1   1   1 1       1                   1 1 1         1 1       1      
var path = require('path');
var fs = require('fs');
 
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
 
function mkdirP (p, opts, f, made) {
    if (typeof opts === 'function') {
        f = opts;
        opts = {};
    }
    else if (!opts || typeof opts !== 'object') {
        opts = { mode: opts };
    }
    
    var mode = opts.mode;
    var xfs = opts.fs || fs;
    
    if (mode === undefined) {
        mode = 0777 & (~process.umask());
    }
    if (!made) made = null;
    
    var cb = f || function () {};
    p = path.resolve(p);
    
    xfs.mkdir(p, mode, function (er) {
        if (!er) {
            made = made || p;
            return cb(null, made);
        }
        switch (er.code) {
            case 'ENOENT':
                mkdirP(path.dirname(p), opts, function (er, made) {
                    if (er) cb(er, made);
                    else mkdirP(p, opts, cb, made);
                });
                break;
 
            // In the case of any other error, just see if there's a dir
            // there already.  If so, then hooray!  If not, then something
            // is borked.
            default:
                xfs.stat(p, function (er2, stat) {
                    // if the stat fails, then that's super weird.
                    // let the original error be the failure reason.
                    if (er2 || !stat.isDirectory()) cb(er, made)
                    else cb(null, made);
                });
                break;
        }
    });
}
 
mkdirP.sync = function sync (p, opts, made) {
    Eif (!opts || typeof opts !== 'object') {
        opts = { mode: opts };
    }
    
    var mode = opts.mode;
    var xfs = opts.fs || fs;
    
    Iif (mode === undefined) {
        mode = 0777 & (~process.umask());
    }
    Eif (!made) made = null;
 
    p = path.resolve(p);
 
    try {
        xfs.mkdirSync(p, mode);
        made = made || p;
    }
    catch (err0) {
        switch (err0.code) {
            case 'ENOENT' :
                made = sync(path.dirname(p), opts, made);
                sync(p, opts, made);
                break;
 
            // In the case of any other error, just see if there's a dir
            // there already.  If so, then hooray!  If not, then something
            // is borked.
            default:
                var stat;
                try {
                    stat = xfs.statSync(p);
                }
                catch (err1) {
                    throw err0;
                }
                Iif (!stat.isDirectory()) throw err0;
                break;
        }
    }
 
    return made;
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/

Statements: 100% (13 / 13)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (13 / 13)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/
File Statements Branches Functions Lines
array.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
collection.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
date.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
function.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
index.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
lang.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
math.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
number.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
object.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
queryString.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
random.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
string.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
time.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57        1                                                                                                        
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'append' : require('./array/append'),
    'collect' : require('./array/collect'),
    'combine' : require('./array/combine'),
    'compact' : require('./array/compact'),
    'contains' : require('./array/contains'),
    'difference' : require('./array/difference'),
    'equals' : require('./array/equals'),
    'every' : require('./array/every'),
    'filter' : require('./array/filter'),
    'find' : require('./array/find'),
    'findIndex' : require('./array/findIndex'),
    'findLast' : require('./array/findLast'),
    'findLastIndex' : require('./array/findLastIndex'),
    'flatten' : require('./array/flatten'),
    'forEach' : require('./array/forEach'),
    'groupBy' : require('./array/groupBy'),
    'indexOf' : require('./array/indexOf'),
    'insert' : require('./array/insert'),
    'intersection' : require('./array/intersection'),
    'invoke' : require('./array/invoke'),
    'join' : require('./array/join'),
    'last' : require('./array/last'),
    'lastIndexOf' : require('./array/lastIndexOf'),
    'map' : require('./array/map'),
    'max' : require('./array/max'),
    'min' : require('./array/min'),
    'pick' : require('./array/pick'),
    'pluck' : require('./array/pluck'),
    'range' : require('./array/range'),
    'reduce' : require('./array/reduce'),
    'reduceRight' : require('./array/reduceRight'),
    'reject' : require('./array/reject'),
    'remove' : require('./array/remove'),
    'removeAll' : require('./array/removeAll'),
    'reverse' : require('./array/reverse'),
    'shuffle' : require('./array/shuffle'),
    'slice' : require('./array/slice'),
    'some' : require('./array/some'),
    'sort' : require('./array/sort'),
    'sortBy' : require('./array/sortBy'),
    'split' : require('./array/split'),
    'take' : require('./array/take'),
    'toLookup' : require('./array/toLookup'),
    'union' : require('./array/union'),
    'unique' : require('./array/unique'),
    'xor' : require('./array/xor'),
    'zip' : require('./array/zip')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24        1                                      
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'contains' : require('./collection/contains'),
    'every' : require('./collection/every'),
    'filter' : require('./collection/filter'),
    'find' : require('./collection/find'),
    'forEach' : require('./collection/forEach'),
    'make_' : require('./collection/make_'),
    'map' : require('./collection/map'),
    'max' : require('./collection/max'),
    'min' : require('./collection/min'),
    'pluck' : require('./collection/pluck'),
    'reduce' : require('./collection/reduce'),
    'reject' : require('./collection/reject'),
    'size' : require('./collection/size'),
    'some' : require('./collection/some')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24        1                                      
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'dayOfTheYear' : require('./date/dayOfTheYear'),
    'diff' : require('./date/diff'),
    'i18n_' : require('./date/i18n_'),
    'isLeapYear' : require('./date/isLeapYear'),
    'isSame' : require('./date/isSame'),
    'parseIso' : require('./date/parseIso'),
    'quarter' : require('./date/quarter'),
    'startOf' : require('./date/startOf'),
    'strftime' : require('./date/strftime'),
    'timezoneAbbr' : require('./date/timezoneAbbr'),
    'timezoneOffset' : require('./date/timezoneOffset'),
    'totalDaysInMonth' : require('./date/totalDaysInMonth'),
    'totalDaysInYear' : require('./date/totalDaysInYear'),
    'weekOfTheYear' : require('./date/weekOfTheYear')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25        1                                        
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'awaitDelay' : require('./function/awaitDelay'),
    'bind' : require('./function/bind'),
    'compose' : require('./function/compose'),
    'constant' : require('./function/constant'),
    'debounce' : require('./function/debounce'),
    'func' : require('./function/func'),
    'identity' : require('./function/identity'),
    'makeIterator_' : require('./function/makeIterator_'),
    'partial' : require('./function/partial'),
    'prop' : require('./function/prop'),
    'series' : require('./function/series'),
    'throttle' : require('./function/throttle'),
    'timeout' : require('./function/timeout'),
    'times' : require('./function/times'),
    'wrap' : require('./function/wrap')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/index.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27              1                                      
/**@license
 * mout v0.11.1 | http://moutjs.com | MIT license
 */
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'VERSION' : '0.11.1',
    'array' : require('./array'),
    'collection' : require('./collection'),
    'date' : require('./date'),
    'function' : require('./function'),
    'lang' : require('./lang'),
    'math' : require('./math'),
    'number' : require('./number'),
    'object' : require('./object'),
    'queryString' : require('./queryString'),
    'random' : require('./random'),
    'string' : require('./string'),
    'time' : require('./time'),
    'fn' : require('./function')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42        1                                                                          
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'GLOBAL' : require('./lang/GLOBAL'),
    'clone' : require('./lang/clone'),
    'createObject' : require('./lang/createObject'),
    'ctorApply' : require('./lang/ctorApply'),
    'deepClone' : require('./lang/deepClone'),
    'deepEquals' : require('./lang/deepEquals'),
    'defaults' : require('./lang/defaults'),
    'inheritPrototype' : require('./lang/inheritPrototype'),
    'is' : require('./lang/is'),
    'isArguments' : require('./lang/isArguments'),
    'isArray' : require('./lang/isArray'),
    'isBoolean' : require('./lang/isBoolean'),
    'isDate' : require('./lang/isDate'),
    'isEmpty' : require('./lang/isEmpty'),
    'isFinite' : require('./lang/isFinite'),
    'isFunction' : require('./lang/isFunction'),
    'isInteger' : require('./lang/isInteger'),
    'isKind' : require('./lang/isKind'),
    'isNaN' : require('./lang/isNaN'),
    'isNull' : require('./lang/isNull'),
    'isNumber' : require('./lang/isNumber'),
    'isObject' : require('./lang/isObject'),
    'isPlainObject' : require('./lang/isPlainObject'),
    'isPrimitive' : require('./lang/isPrimitive'),
    'isRegExp' : require('./lang/isRegExp'),
    'isString' : require('./lang/isString'),
    'isUndefined' : require('./lang/isUndefined'),
    'isnt' : require('./lang/isnt'),
    'kindOf' : require('./lang/kindOf'),
    'toArray' : require('./lang/toArray'),
    'toNumber' : require('./lang/toNumber'),
    'toString' : require('./lang/toString')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21        1                                
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'ceil' : require('./math/ceil'),
    'clamp' : require('./math/clamp'),
    'countSteps' : require('./math/countSteps'),
    'floor' : require('./math/floor'),
    'inRange' : require('./math/inRange'),
    'isNear' : require('./math/isNear'),
    'lerp' : require('./math/lerp'),
    'loop' : require('./math/loop'),
    'map' : require('./math/map'),
    'norm' : require('./math/norm'),
    'round' : require('./math/round')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27        1                                            
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'MAX_INT' : require('./number/MAX_INT'),
    'MAX_SAFE_INTEGER' : require('./number/MAX_SAFE_INTEGER'),
    'MAX_UINT' : require('./number/MAX_UINT'),
    'MIN_INT' : require('./number/MIN_INT'),
    'abbreviate' : require('./number/abbreviate'),
    'currencyFormat' : require('./number/currencyFormat'),
    'enforcePrecision' : require('./number/enforcePrecision'),
    'isNaN' : require('./number/isNaN'),
    'nth' : require('./number/nth'),
    'ordinal' : require('./number/ordinal'),
    'pad' : require('./number/pad'),
    'rol' : require('./number/rol'),
    'ror' : require('./number/ror'),
    'sign' : require('./number/sign'),
    'toInt' : require('./number/toInt'),
    'toUInt' : require('./number/toUInt'),
    'toUInt31' : require('./number/toUInt31')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46        1                                                                                  
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'bindAll' : require('./object/bindAll'),
    'contains' : require('./object/contains'),
    'deepFillIn' : require('./object/deepFillIn'),
    'deepMatches' : require('./object/deepMatches'),
    'deepMixIn' : require('./object/deepMixIn'),
    'equals' : require('./object/equals'),
    'every' : require('./object/every'),
    'fillIn' : require('./object/fillIn'),
    'filter' : require('./object/filter'),
    'find' : require('./object/find'),
    'flatten' : require('./object/flatten'),
    'forIn' : require('./object/forIn'),
    'forOwn' : require('./object/forOwn'),
    'functions' : require('./object/functions'),
    'get' : require('./object/get'),
    'has' : require('./object/has'),
    'hasOwn' : require('./object/hasOwn'),
    'keys' : require('./object/keys'),
    'map' : require('./object/map'),
    'matches' : require('./object/matches'),
    'max' : require('./object/max'),
    'merge' : require('./object/merge'),
    'min' : require('./object/min'),
    'mixIn' : require('./object/mixIn'),
    'namespace' : require('./object/namespace'),
    'omit' : require('./object/omit'),
    'pick' : require('./object/pick'),
    'pluck' : require('./object/pluck'),
    'reduce' : require('./object/reduce'),
    'reject' : require('./object/reject'),
    'result' : require('./object/result'),
    'set' : require('./object/set'),
    'size' : require('./object/size'),
    'some' : require('./object/some'),
    'unset' : require('./object/unset'),
    'values' : require('./object/values')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17        1                        
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'contains' : require('./queryString/contains'),
    'decode' : require('./queryString/decode'),
    'encode' : require('./queryString/encode'),
    'getParam' : require('./queryString/getParam'),
    'getQuery' : require('./queryString/getQuery'),
    'parse' : require('./queryString/parse'),
    'setParam' : require('./queryString/setParam')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20        1                              
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'choice' : require('./random/choice'),
    'guid' : require('./random/guid'),
    'rand' : require('./random/rand'),
    'randBit' : require('./random/randBit'),
    'randBool' : require('./random/randBool'),
    'randHex' : require('./random/randHex'),
    'randInt' : require('./random/randInt'),
    'randSign' : require('./random/randSign'),
    'randString' : require('./random/randString'),
    'random' : require('./random/random')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48        1                                                                                      
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'WHITE_SPACES' : require('./string/WHITE_SPACES'),
    'camelCase' : require('./string/camelCase'),
    'contains' : require('./string/contains'),
    'crop' : require('./string/crop'),
    'endsWith' : require('./string/endsWith'),
    'escapeHtml' : require('./string/escapeHtml'),
    'escapeRegExp' : require('./string/escapeRegExp'),
    'escapeUnicode' : require('./string/escapeUnicode'),
    'hyphenate' : require('./string/hyphenate'),
    'insert' : require('./string/insert'),
    'interpolate' : require('./string/interpolate'),
    'lowerCase' : require('./string/lowerCase'),
    'lpad' : require('./string/lpad'),
    'ltrim' : require('./string/ltrim'),
    'makePath' : require('./string/makePath'),
    'normalizeLineBreaks' : require('./string/normalizeLineBreaks'),
    'pascalCase' : require('./string/pascalCase'),
    'properCase' : require('./string/properCase'),
    'removeNonASCII' : require('./string/removeNonASCII'),
    'removeNonWord' : require('./string/removeNonWord'),
    'repeat' : require('./string/repeat'),
    'replace' : require('./string/replace'),
    'replaceAccents' : require('./string/replaceAccents'),
    'rpad' : require('./string/rpad'),
    'rtrim' : require('./string/rtrim'),
    'sentenceCase' : require('./string/sentenceCase'),
    'slugify' : require('./string/slugify'),
    'startsWith' : require('./string/startsWith'),
    'stripHtmlTags' : require('./string/stripHtmlTags'),
    'trim' : require('./string/trim'),
    'truncate' : require('./string/truncate'),
    'typecast' : require('./string/typecast'),
    'unCamelCase' : require('./string/unCamelCase'),
    'underscore' : require('./string/underscore'),
    'unescapeHtml' : require('./string/unescapeHtml'),
    'unescapeUnicode' : require('./string/unescapeUnicode'),
    'unhyphenate' : require('./string/unhyphenate'),
    'upperCase' : require('./string/upperCase')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14        1                  
 
 
//automatically generated, do not edit!
//run `node build` instead
module.exports = {
    'convert' : require('./time/convert'),
    'now' : require('./time/now'),
    'parseMs' : require('./time/parseMs'),
    'toTimeString' : require('./time/toTimeString')
};
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/

Statements: 29.73% (157 / 528)      Branches: 0% (0 / 207)      Functions: 0% (0 / 67)      Lines: 29.79% (157 / 527)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/
File Statements Branches Functions Lines
append.js 25% (2 / 8) 0% (0 / 2) 0% (0 / 1) 25% (2 / 8)
collect.js 28.57% (4 / 14) 0% (0 / 4) 0% (0 / 1) 28.57% (4 / 14)
combine.js 30% (3 / 10) 0% (0 / 4) 0% (0 / 1) 30% (3 / 10)
compact.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 2) 60% (3 / 5)
contains.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
difference.js 63.64% (7 / 11) 100% (0 / 0) 0% (0 / 3) 63.64% (7 / 11)
equals.js 42.86% (6 / 14) 0% (0 / 10) 0% (0 / 3) 42.86% (6 / 14)
every.js 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
filter.js 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
find.js 60% (3 / 5) 0% (0 / 2) 0% (0 / 1) 60% (3 / 5)
findIndex.js 27.27% (3 / 11) 0% (0 / 4) 0% (0 / 1) 27.27% (3 / 11)
findLast.js 60% (3 / 5) 0% (0 / 2) 0% (0 / 1) 60% (3 / 5)
findLastIndex.js 27.27% (3 / 11) 0% (0 / 4) 0% (0 / 1) 27.27% (3 / 11)
flatten.js 26.32% (5 / 19) 0% (0 / 8) 0% (0 / 2) 26.32% (5 / 19)
forEach.js 25% (2 / 8) 0% (0 / 4) 0% (0 / 1) 25% (2 / 8)
groupBy.js 33.33% (5 / 15) 0% (0 / 4) 0% (0 / 2) 33.33% (5 / 15)
indexOf.js 18.18% (2 / 11) 0% (0 / 8) 0% (0 / 1) 18.18% (2 / 11)
insert.js 50% (4 / 8) 0% (0 / 2) 0% (0 / 1) 50% (4 / 8)
intersection.js 63.64% (7 / 11) 100% (0 / 0) 0% (0 / 3) 63.64% (7 / 11)
invoke.js 27.27% (3 / 11) 0% (0 / 2) 0% (0 / 1) 27.27% (3 / 11)
join.js 57.14% (4 / 7) 0% (0 / 4) 0% (0 / 2) 57.14% (4 / 7)
last.js 40% (2 / 5) 0% (0 / 4) 0% (0 / 1) 40% (2 / 5)
lastIndexOf.js 16.67% (2 / 12) 0% (0 / 10) 0% (0 / 1) 16.67% (2 / 12)
map.js 27.27% (3 / 11) 0% (0 / 2) 0% (0 / 1) 27.27% (3 / 11)
max.js 17.65% (3 / 17) 0% (0 / 10) 0% (0 / 1) 17.65% (3 / 17)
min.js 17.65% (3 / 17) 0% (0 / 10) 0% (0 / 1) 17.65% (3 / 17)
pick.js 28.57% (4 / 14) 0% (0 / 13) 0% (0 / 2) 28.57% (4 / 14)
pluck.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
range.js 25% (3 / 12) 0% (0 / 4) 0% (0 / 1) 25% (3 / 12)
reduce.js 14.29% (2 / 14) 0% (0 / 8) 0% (0 / 1) 14.29% (2 / 14)
reduceRight.js 13.33% (2 / 15) 0% (0 / 8) 0% (0 / 1) 13.33% (2 / 15)
reject.js 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
remove.js 50% (3 / 6) 0% (0 / 2) 0% (0 / 1) 60% (3 / 5)
removeAll.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 1) 42.86% (3 / 7)
reverse.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
shuffle.js 21.43% (3 / 14) 0% (0 / 4) 0% (0 / 1) 21.43% (3 / 14)
slice.js 11.76% (2 / 17) 0% (0 / 8) 0% (0 / 1) 11.76% (2 / 17)
some.js 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
sort.js 15.38% (4 / 26) 0% (0 / 18) 0% (0 / 3) 15.38% (4 / 26)
sortBy.js 44.44% (4 / 9) 0% (0 / 4) 0% (0 / 2) 44.44% (4 / 9)
split.js 13.33% (2 / 15) 0% (0 / 6) 0% (0 / 1) 13.33% (2 / 15)
take.js 20% (2 / 10) 0% (0 / 2) 0% (0 / 1) 20% (2 / 10)
toLookup.js 20% (3 / 15) 0% (0 / 4) 0% (0 / 1) 20% (3 / 15)
union.js 44.44% (4 / 9) 100% (0 / 0) 0% (0 / 1) 44.44% (4 / 9)
unique.js 33.33% (4 / 12) 0% (0 / 4) 0% (0 / 3) 33.33% (4 / 12)
xor.js 45.45% (5 / 11) 100% (0 / 0) 0% (0 / 3) 45.45% (5 / 11)
zip.js 45.45% (5 / 11) 0% (0 / 6) 0% (0 / 3) 45.45% (5 / 11)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/append.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/append.js

Statements: 25% (2 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23            1                         1      
 
 
    /**
     * Appends an array to the end of another.
     * The first array will be modified.
     */
    function append(arr1, arr2) {
        if (arr2 == null) {
            return arr1;
        }
 
        var pad = arr1.length,
            i = -1,
            len = arr2.length;
        while (++i < len) {
            arr1[pad + i] = arr2[i];
        }
        return arr1;
    }
    module.exports = append;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/collect.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/collect.js

Statements: 28.57% (4 / 14)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 28.57% (4 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291 1         1                                   1        
var append = require('./append');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Maps the items in the array and concatenates the result arrays.
     */
    function collect(arr, callback, thisObj){
        callback = makeIterator(callback, thisObj);
        var results = [];
        if (arr == null) {
            return results;
        }
 
        var i = -1, len = arr.length;
        while (++i < len) {
            var value = callback(arr[i], i, arr);
            if (value != null) {
                append(results, value);
            }
        }
 
        return results;
    }
 
    module.exports = collect;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/combine.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/combine.js

Statements: 30% (3 / 10)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 30% (3 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241           1                           1      
var indexOf = require('./indexOf');
 
    /**
     * Combines an array with all the items of another.
     * Does not allow duplicates and is case and type sensitive.
     */
    function combine(arr1, arr2) {
        if (arr2 == null) {
            return arr1;
        }
 
        var i = -1, len = arr2.length;
        while (++i < len) {
            if (indexOf(arr1, arr2[i]) === -1) {
                arr1.push(arr2[i]);
            }
        }
 
        return arr1;
    }
    module.exports = combine;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/compact.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/compact.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151         1           1      
var filter = require('./filter');
 
    /**
     * Remove all null/undefined items from array.
     */
    function compact(arr) {
        return filter(arr, function(val){
            return (val != null);
        });
    }
 
    module.exports = compact;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/contains.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/contains.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121         1     1      
var indexOf = require('./indexOf');
 
    /**
     * If array contains values.
     */
    function contains(arr, val) {
        return indexOf(arr, val) !== -1;
    }
    module.exports = contains;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/difference.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/difference.js

Statements: 63.64% (7 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 63.64% (7 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1 1 1 1           1                   1        
var unique = require('./unique');
var filter = require('./filter');
var some = require('./some');
var contains = require('./contains');
var slice = require('./slice');
 
 
    /**
     * Return a new Array with elements that aren't present in the other Arrays.
     */
    function difference(arr) {
        var arrs = slice(arguments, 1),
            result = filter(unique(arr), function(needle){
                return !some(arrs, function(haystack){
                    return contains(haystack, needle);
                });
            });
        return result;
    }
 
    module.exports = difference;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/equals.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/equals.js

Statements: 42.86% (6 / 14)      Branches: 0% (0 / 10)      Functions: 0% (0 / 3)      Lines: 42.86% (6 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1 1         1                           1           1        
var is = require('../lang/is');
var isArray = require('../lang/isArray');
var every = require('./every');
 
    /**
     * Compares if both arrays have the same elements
     */
    function equals(a, b, callback){
        callback = callback || is;
 
        if (!isArray(a) || !isArray(b)) {
            return callback(a, b);
        }
 
        if (a.length !== b.length) {
            return false;
        }
 
        return every(a, makeCompare(callback), b);
    }
 
    function makeCompare(callback) {
        return function(value, i) {
            return i in this && callback(value, this[i]);
        };
    }
 
    module.exports = equals;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/every.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/every.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291         1                                       1      
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Array every
     */
    function every(arr, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var result = true;
        if (arr == null) {
            return result;
        }
 
        var i = -1, len = arr.length;
        while (++i < len) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            if (!callback(arr[i], i, arr) ) {
                result = false;
                break;
            }
        }
 
        return result;
    }
 
    module.exports = every;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/filter.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/filter.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 281         1                                   1        
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Array filter
     */
    function filter(arr, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var results = [];
        if (arr == null) {
            return results;
        }
 
        var i = -1, len = arr.length, value;
        while (++i < len) {
            value = arr[i];
            if (callback(value, i, arr)) {
                results.push(value);
            }
        }
 
        return results;
    }
 
    module.exports = filter;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/find.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/find.js

Statements: 60% (3 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151         1         1        
var findIndex = require('./findIndex');
 
    /**
     * Returns first item that matches criteria
     */
    function find(arr, iterator, thisObj){
        var idx = findIndex(arr, iterator, thisObj);
        return idx >= 0? arr[idx] : void(0);
    }
 
    module.exports = find;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/findIndex.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/findIndex.js

Statements: 27.27% (3 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251         1                               1      
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Returns the index of the first item that matches criteria
     */
    function findIndex(arr, iterator, thisObj){
        iterator = makeIterator(iterator, thisObj);
        if (arr == null) {
            return -1;
        }
 
        var i = -1, len = arr.length;
        while (++i < len) {
            if (iterator(arr[i], i, arr)) {
                return i;
            }
        }
 
        return -1;
    }
 
    module.exports = findIndex;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/findLast.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/findLast.js

Statements: 60% (3 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151         1         1        
var findLastIndex = require('./findLastIndex');
 
    /**
     * Returns last item that matches criteria
     */
    function findLast(arr, iterator, thisObj){
        var idx = findLastIndex(arr, iterator, thisObj);
        return idx >= 0? arr[idx] : void(0);
    }
 
    module.exports = findLast;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/findLastIndex.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/findLastIndex.js

Statements: 27.27% (3 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261         1                               1        
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Returns the index of the last item that matches criteria
     */
    function findLastIndex(arr, iterator, thisObj){
        iterator = makeIterator(iterator, thisObj);
        if (arr == null) {
            return -1;
        }
 
        var n = arr.length;
        while (--n >= 0) {
            if (iterator(arr[n], n, arr)) {
                return n;
            }
        }
 
        return -1;
    }
 
    module.exports = findLastIndex;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/flatten.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/flatten.js

Statements: 26.32% (5 / 19)      Branches: 0% (0 / 8)      Functions: 0% (0 / 2)      Lines: 26.32% (5 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 471 1           1                                                 1                 1          
var isArray = require('../lang/isArray');
var append = require('./append');
 
    /*
     * Helper function to flatten to a destination array.
     * Used to remove the need to create intermediate arrays while flattening.
     */
    function flattenTo(arr, result, level) {
        if (level === 0) {
            append(result, arr);
            return result;
        }
 
        var value,
            i = -1,
            len = arr.length;
        while (++i < len) {
            value = arr[i];
            if (isArray(value)) {
                flattenTo(value, result, level - 1);
            } else {
                result.push(value);
            }
        }
        return result;
    }
 
    /**
     * Recursively flattens an array.
     * A new array containing all the elements is returned.
     * If level is specified, it will only flatten up to that level.
     */
    function flatten(arr, level) {
        if (arr == null) {
            return [];
        }
 
        level = level == null ? -1 : level;
        return flattenTo(arr, [], level);
    }
 
    module.exports = flatten;
 
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/forEach.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/forEach.js

Statements: 25% (2 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25          1                             1        
 
 
    /**
     * Array forEach
     */
    function forEach(arr, callback, thisObj) {
        if (arr == null) {
            return;
        }
        var i = -1,
            len = arr.length;
        while (++i < len) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            if ( callback.call(thisObj, arr[i], i, arr) === false ) {
                break;
            }
        }
    }
 
    module.exports = forEach;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/groupBy.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/groupBy.js

Statements: 33.33% (5 / 15)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 33.33% (5 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1 1         1                                         1      
var forEach = require('../array/forEach');
var identity = require('../function/identity');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Bucket the array values.
     */
    function groupBy(arr, categorize, thisObj) {
        if (categorize) {
            categorize = makeIterator(categorize, thisObj);
        } else {
            // Default to identity function.
            categorize = identity;
        }
 
        var buckets = {};
        forEach(arr, function(element) {
            var bucket = categorize(element);
            if (!(bucket in buckets)) {
                buckets[bucket] = [];
            }
 
            buckets[bucket].push(element);
        });
 
        return buckets;
    }
 
    module.exports = groupBy;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/indexOf.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/indexOf.js

Statements: 18.18% (2 / 11)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30          1                                         1      
 
 
    /**
     * Array.indexOf
     */
    function indexOf(arr, item, fromIndex) {
        fromIndex = fromIndex || 0;
        if (arr == null) {
            return -1;
        }
 
        var len = arr.length,
            i = fromIndex < 0 ? len + fromIndex : fromIndex;
        while (i < len) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            if (arr[i] === item) {
                return i;
            }
 
            i++;
        }
 
        return -1;
    }
 
    module.exports = indexOf;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/insert.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/insert.js

Statements: 50% (4 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (4 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1         1             1      
var difference = require('./difference');
var slice = require('./slice');
 
    /**
     * Insert item into array if not already present.
     */
    function insert(arr, rest_items) {
        var diff = difference(slice(arguments, 1), arr);
        if (diff.length) {
            Array.prototype.push.apply(arr, diff);
        }
        return arr.length;
    }
    module.exports = insert;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/intersection.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/intersection.js

Statements: 63.64% (7 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 63.64% (7 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1 1 1 1             1                   1        
var unique = require('./unique');
var filter = require('./filter');
var every = require('./every');
var contains = require('./contains');
var slice = require('./slice');
 
 
    /**
     * Return a new Array with elements common to all Arrays.
     * - based on underscore.js implementation
     */
    function intersection(arr) {
        var arrs = slice(arguments, 1),
            result = filter(unique(arr), function(needle){
                return every(arrs, function(haystack){
                    return contains(haystack, needle);
                });
            });
        return result;
    }
 
    module.exports = intersection;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/invoke.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/invoke.js

Statements: 27.27% (3 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251           1                             1      
var slice = require('./slice');
 
    /**
     * Call `methodName` on each item of the array passing custom arguments if
     * needed.
     */
    function invoke(arr, methodName, var_args){
        if (arr == null) {
            return arr;
        }
 
        var args = slice(arguments, 2);
        var i = -1, len = arr.length, value;
        while (++i < len) {
            value = arr[i];
            value[methodName].apply(value, args);
        }
 
        return arr;
    }
 
    module.exports = invoke;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/join.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/join.js

Statements: 57.14% (4 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191   1               1         1      
var filter = require('./filter');
 
    function isValidString(val) {
        return (val != null && val !== '');
    }
 
    /**
     * Joins strings with the specified separator inserted between each value.
     * Null values and empty strings will be excluded.
     */
    function join(items, separator) {
        separator = separator || '';
        return filter(items, isValidString).join(separator);
    }
 
    module.exports = join;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/last.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/last.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18          1               1        
 
 
    /**
     * Returns last element of array.
     */
    function last(arr){
        if (arr == null || arr.length < 1) {
            return undefined;
        }
 
        return arr[arr.length - 1];
    }
 
    module.exports = last;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/lastIndexOf.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/lastIndexOf.js

Statements: 16.67% (2 / 12)      Branches: 0% (0 / 10)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30          1                                         1      
 
 
    /**
     * Array lastIndexOf
     */
    function lastIndexOf(arr, item, fromIndex) {
        if (arr == null) {
            return -1;
        }
 
        var len = arr.length;
        fromIndex = (fromIndex == null || fromIndex >= len)? len - 1 : fromIndex;
        fromIndex = (fromIndex < 0)? len + fromIndex : fromIndex;
 
        while (fromIndex >= 0) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            if (arr[fromIndex] === item) {
                return fromIndex;
            }
            fromIndex--;
        }
 
        return -1;
    }
 
    module.exports = lastIndexOf;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/map.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/map.js

Statements: 27.27% (3 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241         1                             1      
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Array map
     */
    function map(arr, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var results = [];
        if (arr == null){
            return results;
        }
 
        var i = -1, len = arr.length;
        while (++i < len) {
            results[i] = callback(arr[i], i, arr);
        }
 
        return results;
    }
 
     module.exports = map;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/max.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/max.js

Statements: 17.65% (3 / 17)      Branches: 0% (0 / 10)      Functions: 0% (0 / 1)      Lines: 17.65% (3 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361         1                                                   1        
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Return maximum value inside array
     */
    function max(arr, iterator, thisObj){
        if (arr == null || !arr.length) {
            return Infinity;
        } else if (arr.length && !iterator) {
            return Math.max.apply(Math, arr);
        } else {
            iterator = makeIterator(iterator, thisObj);
            var result,
                compare = -Infinity,
                value,
                temp;
 
            var i = -1, len = arr.length;
            while (++i < len) {
                value = arr[i];
                temp = iterator(value, i, arr);
                if (temp > compare) {
                    compare = temp;
                    result = value;
                }
            }
 
            return result;
        }
    }
 
    module.exports = max;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/min.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/min.js

Statements: 17.65% (3 / 17)      Branches: 0% (0 / 10)      Functions: 0% (0 / 1)      Lines: 17.65% (3 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361         1                                                   1        
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Return minimum value inside array
     */
    function min(arr, iterator, thisObj){
        if (arr == null || !arr.length) {
            return -Infinity;
        } else if (arr.length && !iterator) {
            return Math.min.apply(Math, arr);
        } else {
            iterator = makeIterator(iterator, thisObj);
            var result,
                compare = Infinity,
                value,
                temp;
 
            var i = -1, len = arr.length;
            while (++i < len) {
                value = arr[i];
                temp = iterator(value, i, arr);
                if (temp < compare) {
                    compare = temp;
                    result = value;
                }
            }
 
            return result;
        }
    }
 
    module.exports = min;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/pick.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/pick.js

Statements: 28.57% (4 / 14)      Branches: 0% (0 / 13)      Functions: 0% (0 / 2)      Lines: 28.57% (4 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 331             1                             1           1        
var randInt = require('../random/randInt');
 
    /**
     * Remove random item(s) from the Array and return it.
     * Returns an Array of items if [nItems] is provided or a single item if
     * it isn't specified.
     */
    function pick(arr, nItems){
        if (nItems != null) {
            var result = [];
            if (nItems > 0 && arr && arr.length) {
                nItems = nItems > arr.length? arr.length : nItems;
                while (nItems--) {
                    result.push( pickOne(arr) );
                }
            }
            return result;
        }
        return (arr && arr.length)? pickOne(arr) : void(0);
    }
 
 
    function pickOne(arr){
        var idx = randInt(0, arr.length - 1);
        return arr.splice(idx, 1)[0];
    }
 
 
    module.exports = pick;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/pluck.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/pluck.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1       1        
var map = require('./map');
 
    /**
     * Extract a list of property values.
     */
    function pluck(arr, propName){
        return map(arr, propName);
    }
 
    module.exports = pluck;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/range.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/range.js

Statements: 25% (3 / 12)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 25% (3 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291         1                                     1        
var countSteps = require('../math/countSteps');
 
    /**
     * Returns an Array of numbers inside range.
     */
    function range(start, stop, step) {
        if (stop == null) {
            stop = start;
            start = 0;
        }
        step = step || 1;
 
        var result = [],
            nSteps = countSteps(stop - start, step),
            i = start;
 
        while (i <= stop) {
            result.push(i);
            i += step;
        }
 
        return result;
    }
 
    module.exports = range;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/reduce.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/reduce.js

Statements: 14.29% (2 / 14)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 14.29% (2 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35          1                                                   1      
 
 
    /**
     * Array reduce
     */
    function reduce(arr, fn, initVal) {
        // check for args.length since initVal might be "undefined" see #gh-57
        var hasInit = arguments.length > 2,
            result = initVal;
 
        if (arr == null || !arr.length) {
            if (!hasInit) {
                throw new Error('reduce of empty array with no initial value');
            } else {
                return initVal;
            }
        }
 
        var i = -1, len = arr.length;
        while (++i < len) {
            if (!hasInit) {
                result = arr[i];
                hasInit = true;
            } else {
                result = fn(result, arr[i], i, arr);
            }
        }
 
        return result;
    }
 
    module.exports = reduce;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/reduceRight.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/reduceRight.js

Statements: 13.33% (2 / 15)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36          1                                                     1      
 
 
    /**
     * Array reduceRight
     */
    function reduceRight(arr, fn, initVal) {
        // check for args.length since initVal might be "undefined" see #gh-57
        var hasInit = arguments.length > 2;
 
        if (arr == null || !arr.length) {
            if (hasInit) {
                return initVal;
            } else {
                throw new Error('reduce of empty array with no initial value');
            }
        }
 
        var i = arr.length, result = initVal, value;
        while (--i >= 0) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            value = arr[i];
            if (!hasInit) {
                result = value;
                hasInit = true;
            } else {
                result = fn(result, value, i, arr);
            }
        }
        return result;
    }
 
    module.exports = reduceRight;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/reject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/reject.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271         1                                   1      
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Array reject
     */
    function reject(arr, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var results = [];
        if (arr == null) {
            return results;
        }
 
        var i = -1, len = arr.length, value;
        while (++i < len) {
            value = arr[i];
            if (!callback(value, i, arr)) {
                results.push(value);
            }
        }
 
        return results;
    }
 
    module.exports = reject;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/remove.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/remove.js

Statements: 50% (3 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151           1         1      
var indexOf = require('./indexOf');
 
    /**
     * Remove a single item from the array.
     * (it won't remove duplicates, just a single item)
     */
    function remove(arr, item){
        var idx = indexOf(arr, item);
        if (idx !== -1) arr.splice(idx, 1);
    }
 
    module.exports = remove;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/removeAll.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/removeAll.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171         1               1      
var indexOf = require('./indexOf');
 
    /**
     * Remove all instances of an item from array.
     */
    function removeAll(arr, item){
        var idx = indexOf(arr, item);
        while (idx !== -1) {
            arr.splice(idx, 1);
            idx = indexOf(arr, item, idx);
        }
    }
 
    module.exports = removeAll;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/reverse.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/reverse.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16          1           1        
 
 
    /**
     * Returns a copy of the array in reversed order.
     */
    function reverse(array) {
        var copy = array.slice();
        copy.reverse();
        return copy;
    }
 
    module.exports = reverse;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/shuffle.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/shuffle.js

Statements: 21.43% (3 / 14)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 21.43% (3 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301         1                                         1      
var randInt = require('../random/randInt');
 
    /**
     * Shuffle array items.
     */
    function shuffle(arr) {
        var results = [],
            rnd;
        if (arr == null) {
            return results;
        }
 
        var i = -1, len = arr.length, value;
        while (++i < len) {
            if (!i) {
                results[0] = arr[0];
            } else {
                rnd = randInt(0, i);
                results[i] = results[rnd];
                results[rnd] = arr[i];
            }
        }
 
        return results;
    }
 
    module.exports = shuffle;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/slice.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/slice.js

Statements: 11.76% (2 / 17)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 11.76% (2 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37          1                                                     1        
 
 
    /**
     * Create slice of source array or array-like object
     */
    function slice(arr, start, end){
        var len = arr.length;
 
        if (start == null) {
            start = 0;
        } else if (start < 0) {
            start = Math.max(len + start, 0);
        } else {
            start = Math.min(start, len);
        }
 
        if (end == null) {
            end = len;
        } else if (end < 0) {
            end = Math.max(len + end, 0);
        } else {
            end = Math.min(end, len);
        }
 
        var result = [];
        while (start < end) {
            result.push(arr[start++]);
        }
 
        return result;
    }
 
    module.exports = slice;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/some.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/some.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291         1                                       1      
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Array some
     */
    function some(arr, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var result = false;
        if (arr == null) {
            return result;
        }
 
        var i = -1, len = arr.length;
        while (++i < len) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            if ( callback(arr[i], i, arr) ) {
                result = true;
                break;
            }
        }
 
        return result;
    }
 
    module.exports = some;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/sort.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/sort.js

Statements: 15.38% (4 / 26)      Branches: 0% (0 / 18)      Functions: 0% (0 / 3)      Lines: 15.38% (4 / 26)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57          1                                       1       1                                             1        
 
 
    /**
     * Merge sort (http://en.wikipedia.org/wiki/Merge_sort)
     */
    function mergeSort(arr, compareFn) {
        if (arr == null) {
            return [];
        } else if (arr.length < 2) {
            return arr;
        }
 
        if (compareFn == null) {
            compareFn = defaultCompare;
        }
 
        var mid, left, right;
 
        mid   = ~~(arr.length / 2);
        left  = mergeSort( arr.slice(0, mid), compareFn );
        right = mergeSort( arr.slice(mid, arr.length), compareFn );
 
        return merge(left, right, compareFn);
    }
 
    function defaultCompare(a, b) {
        return a < b ? -1 : (a > b? 1 : 0);
    }
 
    function merge(left, right, compareFn) {
        var result = [];
 
        while (left.length && right.length) {
            if (compareFn(left[0], right[0]) <= 0) {
                // if 0 it should preserve same order (stable)
                result.push(left.shift());
            } else {
                result.push(right.shift());
            }
        }
 
        if (left.length) {
            result.push.apply(result, left);
        }
 
        if (right.length) {
            result.push.apply(result, right);
        }
 
        return result;
    }
 
    module.exports = mergeSort;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/sortBy.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/sortBy.js

Statements: 44.44% (4 / 9)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1         1                   1        
var sort = require('./sort');
var makeIterator = require('../function/makeIterator_');
 
    /*
     * Sort array by the result of the callback
     */
    function sortBy(arr, callback, context){
        callback = makeIterator(callback, context);
 
        return sort(arr, function(a, b) {
            a = callback(a);
            b = callback(b);
            return (a < b) ? -1 : ((a > b) ? 1 : 0);
        });
    }
 
    module.exports = sortBy;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/split.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/split.js

Statements: 13.33% (2 / 15)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37          1                                                       1      
 
 
    /**
     * Split array into a fixed number of segments.
     */
    function split(array, segments) {
        segments = segments || 2;
        var results = [];
        if (array == null) {
            return results;
        }
 
        var minLength = Math.floor(array.length / segments),
            remainder = array.length % segments,
            i = 0,
            len = array.length,
            segmentIndex = 0,
            segmentLength;
 
        while (i < len) {
            segmentLength = minLength;
            if (segmentIndex < remainder) {
                segmentLength++;
            }
 
            results.push(array.slice(i, i + segmentLength));
 
            segmentIndex++;
            i += segmentLength;
        }
 
        return results;
    }
    module.exports = split;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/take.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/take.js

Statements: 20% (2 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26            1                             1        
 
 
    /**
     * Iterates over a callback a set amount of times
     * returning the results
     */
    function take(n, callback, thisObj){
        var i = -1;
        var arr = [];
        if( !thisObj ){
            while(++i < n){
                arr[i] = callback(i, n);
            }
        } else {
            while(++i < n){
                arr[i] = callback.call(thisObj, i, n);
            }
        }
        return arr;
    }
 
    module.exports = take;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/toLookup.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/toLookup.js

Statements: 20% (3 / 15)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 20% (3 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301         1                                         1      
var isFunction = require('../lang/isFunction');
 
    /**
     * Creates an object that holds a lookup for the objects in the array.
     */
    function toLookup(arr, key) {
        var result = {};
        if (arr == null) {
            return result;
        }
 
        var i = -1, len = arr.length, value;
        if (isFunction(key)) {
            while (++i < len) {
                value = arr[i];
                result[key(value)] = value;
            }
        } else {
            while (++i < len) {
                value = arr[i];
                result[value[key]] = value;
            }
        }
 
        return result;
    }
    module.exports = toLookup;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/union.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/union.js

Statements: 44.44% (4 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1         1                   1        
var unique = require('./unique');
var append = require('./append');
 
    /**
     * Concat multiple arrays and remove duplicates
     */
    function union(arrs) {
        var results = [];
        var i = -1, len = arguments.length;
        while (++i < len) {
            append(results, arguments[i]);
        }
 
        return unique(results);
    }
 
    module.exports = union;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/unique.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/unique.js

Statements: 33.33% (4 / 12)      Branches: 0% (0 / 4)      Functions: 0% (0 / 3)      Lines: 33.33% (4 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271         1                         1       1        
var filter = require('./filter');
 
    /**
     * @return {array} Array of unique items
     */
    function unique(arr, compare){
        compare = compare || isEqual;
        return filter(arr, function(item, i, arr){
            var n = arr.length;
            while (++i < n) {
                if ( compare(item, arr[i]) ) {
                    return false;
                }
            }
            return true;
        });
    }
 
    function isEqual(a, b){
        return a === b;
    }
 
    module.exports = unique;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/xor.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/xor.js

Statements: 45.45% (5 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 45.45% (5 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 281 1 1             1                           1        
var unique = require('./unique');
var filter = require('./filter');
var contains = require('./contains');
 
 
    /**
     * Exclusive OR. Returns items that are present in a single array.
     * - like ptyhon's `symmetric_difference`
     */
    function xor(arr1, arr2) {
        arr1 = unique(arr1);
        arr2 = unique(arr2);
 
        var a1 = filter(arr1, function(item){
                return !contains(arr2, item);
            }),
            a2 = filter(arr2, function(item){
                return !contains(arr1, item);
            });
 
        return a1.concat(a2);
    }
 
    module.exports = xor;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/zip.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/array/zip.js

Statements: 45.45% (5 / 11)      Branches: 0% (0 / 6)      Functions: 0% (0 / 3)      Lines: 45.45% (5 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301 1   1               1                           1        
var max = require('./max');
var map = require('./map');
 
    function getLength(arr) {
        return arr == null ? 0 : arr.length;
    }
 
    /**
     * Merges together the values of each of the arrays with the values at the
     * corresponding position.
     */
    function zip(arr){
        var len = arr ? max(map(arguments, getLength)) : 0,
            results = [],
            i = -1;
        while (++i < len) {
            // jshint loopfunc: true
            results.push(map(arguments, function(item) {
                return item == null ? undefined : item[i];
            }));
        }
 
        return results;
    }
 
    module.exports = zip;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/

Statements: 67.86% (57 / 84)      Branches: 0% (0 / 16)      Functions: 9.09% (1 / 11)      Lines: 67.86% (57 / 84)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/
File Statements Branches Functions Lines
contains.js 100% (4 / 4) 100% (0 / 0) 100% (0 / 0) 100% (4 / 4)
every.js 100% (4 / 4) 100% (0 / 0) 100% (0 / 0) 100% (4 / 4)
filter.js 33.33% (4 / 12) 0% (0 / 4) 0% (0 / 2) 33.33% (4 / 12)
find.js 100% (4 / 4) 100% (0 / 0) 100% (0 / 0) 100% (4 / 4)
forEach.js 100% (4 / 4) 100% (0 / 0) 100% (0 / 0) 100% (4 / 4)
make_.js 50% (4 / 8) 0% (0 / 4) 50% (1 / 2) 50% (4 / 8)
map.js 54.55% (6 / 11) 0% (0 / 4) 0% (0 / 2) 54.55% (6 / 11)
max.js 100% (4 / 4) 100% (0 / 0) 100% (0 / 0) 100% (4 / 4)
min.js 100% (4 / 4) 100% (0 / 0) 100% (0 / 0) 100% (4 / 4)
pluck.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 2) 60% (3 / 5)
reduce.js 100% (4 / 4) 100% (0 / 0) 100% (0 / 0) 100% (4 / 4)
reject.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 2) 57.14% (4 / 7)
size.js 44.44% (4 / 9) 0% (0 / 4) 0% (0 / 1) 44.44% (4 / 9)
some.js 100% (4 / 4) 100% (0 / 0) 100% (0 / 0) 100% (4 / 4)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/contains.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/contains.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111 1 1       1        
var make = require('./make_');
var arrContains = require('../array/contains');
var objContains = require('../object/contains');
 
    /**
     */
    module.exports = make(arrContains, objContains);
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/every.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/every.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111 1 1       1        
var make = require('./make_');
var arrEvery = require('../array/every');
var objEvery = require('../object/every');
 
    /**
     */
    module.exports = make(arrEvery, objEvery);
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/filter.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/filter.js

Statements: 33.33% (4 / 12)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 33.33% (4 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1         1                           1        
var forEach = require('./forEach');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * filter collection values, returns array.
     */
    function filter(list, iterator, thisObj) {
        iterator = makeIterator(iterator, thisObj);
        var results = [];
        if (!list) {
            return results;
        }
        forEach(list, function(value, index, list) {
            if (iterator(value, index, list)) {
                results[results.length] = value;
            }
        });
        return results;
    }
 
    module.exports = filter;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/find.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/find.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1 1         1        
var make = require('./make_');
var arrFind = require('../array/find');
var objFind = require('../object/find');
 
    /**
     * Find value that returns true on iterator check.
     */
    module.exports = make(arrFind, objFind);
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/forEach.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/forEach.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111 1 1       1        
var make = require('./make_');
var arrForEach = require('../array/forEach');
var objForEach = require('../object/forOwn');
 
    /**
     */
    module.exports = make(arrForEach, objForEach);
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/make_.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/make_.js

Statements: 50% (4 / 8)      Branches: 0% (0 / 4)      Functions: 50% (1 / 2)      Lines: 50% (4 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211         1 8                   1        
var slice = require('../array/slice');
 
    /**
     * internal method used to create other collection modules.
     */
    function makeCollectionMethod(arrMethod, objMethod, defaultReturn) {
        return function(){
            var args = slice(arguments);
            if (args[0] == null) {
                return defaultReturn;
            }
            // array-like is treated as array
            return (typeof args[0].length === 'number')? arrMethod.apply(null, args) : objMethod.apply(null, args);
        };
    }
 
    module.exports = makeCollectionMethod;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/map.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/map.js

Statements: 54.55% (6 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 54.55% (6 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1 1 1         1                       1        
var isObject = require('../lang/isObject');
var values = require('../object/values');
var arrMap = require('../array/map');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Map collection values, returns Array.
     */
    function map(list, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        // list.length to check array-like object, if not array-like
        // we simply map all the object values
        if( isObject(list) && list.length == null ){
            list = values(list);
        }
        return arrMap(list, function (val, key, list) {
            return callback(val, key, list);
        });
    }
 
    module.exports = map;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/max.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/max.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1 1         1        
var make = require('./make_');
var arrMax = require('../array/max');
var objMax = require('../object/max');
 
    /**
     * Get maximum value inside collection
     */
    module.exports = make(arrMax, objMax);
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/min.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/min.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1 1         1        
var make = require('./make_');
var arrMin = require('../array/min');
var objMin = require('../object/min');
 
    /**
     * Get minimum value inside collection.
     */
    module.exports = make(arrMin, objMin);
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/pluck.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/pluck.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161         1           1        
var map = require('./map');
 
    /**
     * Extract a list of property values.
     */
    function pluck(list, key) {
        return map(list, function(value) {
            return value[key];
        });
    }
 
    module.exports = pluck;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/reduce.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/reduce.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111 1 1       1        
var make = require('./make_');
var arrReduce = require('../array/reduce');
var objReduce = require('../object/reduce');
 
    /**
     */
    module.exports = make(arrReduce, objReduce);
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/reject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/reject.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1         1             1        
var filter = require('./filter');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Inverse or collection/filter
     */
    function reject(list, iterator, thisObj) {
        iterator = makeIterator(iterator, thisObj);
        return filter(list, function(value, index, list) {
            return !iterator(value, index, list);
        }, thisObj);
    }
 
    module.exports = reject;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/size.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/size.js

Statements: 44.44% (4 / 9)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1         1                   1        
var isArray = require('../lang/isArray');
var objSize = require('../object/size');
 
    /**
     * Get collection size
     */
    function size(list) {
        if (!list) {
            return 0;
        }
        if (isArray(list)) {
            return list.length;
        }
        return objSize(list);
    }
 
    module.exports = size;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/some.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/collection/some.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111 1 1       1        
var make = require('./make_');
var arrSome = require('../array/some');
var objSome = require('../object/some');
 
    /**
     */
    module.exports = make(arrSome, objSome);
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/

Statements: 27.88% (75 / 269)      Branches: 0% (0 / 156)      Functions: 0% (0 / 33)      Lines: 28.2% (75 / 266)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/
File Statements Branches Functions Lines
dayOfTheYear.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
diff.js 19.67% (12 / 61) 0% (0 / 24) 0% (0 / 8) 19.67% (12 / 61)
i18n_.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
isLeapYear.js 50% (3 / 6) 0% (0 / 5) 0% (0 / 1) 50% (3 / 6)
isSame.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 1) 42.86% (3 / 7)
parseIso.js 22.73% (15 / 66) 0% (0 / 50) 0% (0 / 9) 22.73% (15 / 66)
quarter.js 20% (2 / 10) 0% (0 / 6) 0% (0 / 1) 28.57% (2 / 7)
startOf.js 14.29% (3 / 21) 0% (0 / 14) 0% (0 / 1) 14.29% (3 / 21)
strftime.js 24.07% (13 / 54) 0% (0 / 41) 0% (0 / 5) 24.07% (13 / 54)
timezoneAbbr.js 60% (3 / 5) 0% (0 / 2) 0% (0 / 1) 60% (3 / 5)
timezoneOffset.js 37.5% (3 / 8) 0% (0 / 2) 0% (0 / 1) 37.5% (3 / 8)
totalDaysInMonth.js 50% (5 / 10) 0% (0 / 6) 0% (0 / 1) 50% (5 / 10)
totalDaysInYear.js 75% (3 / 4) 0% (0 / 2) 0% (0 / 1) 75% (3 / 4)
weekOfTheYear.js 37.5% (3 / 8) 0% (0 / 2) 0% (0 / 1) 37.5% (3 / 8)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/dayOfTheYear.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/dayOfTheYear.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151         1         1        
var isDate = require('../lang/isDate');
 
    /**
     * return the day of the year (1..366)
     */
    function dayOfTheYear(date){
        return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) -
                Date.UTC(date.getFullYear(), 0, 1)) / 86400000 + 1;
    }
 
    module.exports = dayOfTheYear;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/diff.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/diff.js

Statements: 19.67% (12 / 61)      Branches: 0% (0 / 24)      Functions: 0% (0 / 8)      Lines: 19.67% (12 / 61)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 1321 1 1         1                                                         1                         1             1           1                         1                   1                                                                 1                 1        
var totalDaysInMonth = require('./totalDaysInMonth');
var totalDaysInYear = require('./totalDaysInYear');
var convert = require('../time/convert');
 
    /**
     * calculate the difference between dates (range)
     */
    function diff(start, end, unitName){
        // sort the dates to make it easier to process (specially year/month)
        if (start > end) {
            var swap = start;
            start = end;
            end = swap;
        }
 
        var output;
 
        if (unitName === 'month') {
            output = getMonthsDiff(start, end);
        } else if (unitName === 'year'){
            output = getYearsDiff(start, end);
        } else if (unitName != null) {
            if (unitName === 'day') {
                // ignore timezone difference because of daylight savings time
                start = toUtc(start);
                end = toUtc(end);
            }
            output = convert(end - start, 'ms', unitName);
        } else {
            output = end - start;
        }
 
        return output;
    }
 
 
    function toUtc(d){
        // we ignore timezone differences on purpose because of daylight
        // savings time, otherwise it would return fractional days/weeks even
        // if a full day elapsed. eg:
        // Wed Feb 12 2014 00:00:00 GMT-0200 (BRST)
        // Sun Feb 16 2014 00:00:00 GMT-0300 (BRT)
        // diff should be 4 days and not 4.041666666666667
        return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(),
                        d.getHours(), d.getMinutes(), d.getSeconds(),
                        d.getMilliseconds());
    }
 
 
    function getMonthsDiff(start, end){
        return getElapsedMonths(start, end) +
               getElapsedYears(start, end) * 12 +
               getFractionalMonth(start, end);
    }
 
 
    function getYearsDiff(start, end){
        var elapsedYears = getElapsedYears(start, end);
        return elapsedYears + getFractionalYear(start, end, elapsedYears);
    }
 
 
    function getElapsedMonths(start, end){
        var monthDiff = end.getMonth() - start.getMonth();
        if (monthDiff < 0) {
            monthDiff += 12;
        }
        // less than a full month
        if (start.getDate() > end.getDate()) {
            monthDiff -= 1;
        }
        return monthDiff;
    }
 
 
    function getElapsedYears(start, end){
        var yearDiff = end.getFullYear() - start.getFullYear();
        // less than a full year
        if (start.getMonth() > end.getMonth()) {
            yearDiff -= 1;
        }
        return yearDiff;
    }
 
 
    function getFractionalMonth(start, end){
        var fractionalDiff = 0;
        var startDay = start.getDate();
        var endDay = end.getDate();
 
        if (startDay !== endDay) {
            var startTotalDays = totalDaysInMonth(start);
            var endTotalDays = totalDaysInMonth(end);
            var totalDays;
            var daysElapsed;
 
            if (startDay > endDay) {
                // eg: Jan 29 - Feb 27 (29 days elapsed but not a full month)
                var baseDay = startTotalDays - startDay;
                daysElapsed = endDay + baseDay;
                // total days should be relative to 1st day of next month if
                // startDay > endTotalDays
                totalDays = (startDay > endTotalDays)?
                    endTotalDays + baseDay + 1 : startDay + baseDay;
            } else {
                // fractional is only based on endMonth eg: Jan 12 - Feb 18
                // (6 fractional days, 28 days until next full month)
                daysElapsed = endDay - startDay;
                totalDays = endTotalDays;
            }
 
            fractionalDiff = daysElapsed / totalDays;
        }
 
        return fractionalDiff;
    }
 
 
    function getFractionalYear(start, end, elapsedYears){
        var base = elapsedYears?
            new Date(end.getFullYear(), start.getMonth(), start.getDate()) :
            start;
        var elapsedDays = diff(base, end, 'day');
        return elapsedDays / totalDaysInYear(end);
    }
 
 
    module.exports = diff;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/i18n_.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/i18n_.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1     1             1        
var mixIn = require('../object/mixIn');
var enUS = require('./i18n/en-US');
 
    // we also use mixIn to make sure we don't affect the original locale
    var activeLocale = mixIn({}, enUS, {
        // we expose a "set" method to allow overriding the global locale
        set : function(localeData){
            mixIn(activeLocale, localeData);
        }
    });
 
    module.exports = activeLocale;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/isLeapYear.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/isLeapYear.js

Statements: 50% (3 / 6)      Branches: 0% (0 / 5)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171         1             1        
var isDate = require('../lang/isDate');
 
    /**
     * checks if it's a leap year
     */
    function isLeapYear(fullYear){
        if (isDate(fullYear)) {
            fullYear = fullYear.getFullYear();
        }
        return fullYear % 400 === 0 || (fullYear % 100 !== 0 && fullYear % 4 === 0);
    }
 
    module.exports = isLeapYear;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/isSame.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/isSame.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var startOf = require('./startOf');
 
    /**
     * Check if date is "same" with optional period
     */
    function isSame(date1, date2, period){
        if (period) {
            date1 = startOf(date1, period);
            date2 = startOf(date2, period);
        }
        return Number(date1) === Number(date2);
    }
 
    module.exports = isSame;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/parseIso.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/parseIso.js

Statements: 22.73% (15 / 66)      Branches: 0% (0 / 50)      Functions: 0% (0 / 9)      Lines: 22.73% (15 / 66)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 1481   1         1   1           1 1   1                 1                           1                             1                               1                         1                                             1                                                 1                   1        
var some = require('../array/some');
 
    var datePatterns = [
        /^([0-9]{4})$/,                        // YYYY
        /^([0-9]{4})-([0-9]{2})$/,             // YYYY-MM (YYYYMM not allowed)
        /^([0-9]{4})-?([0-9]{2})-?([0-9]{2})$/ // YYYY-MM-DD or YYYYMMDD
    ];
    var ORD_DATE = /^([0-9]{4})-?([0-9]{3})$/; // YYYY-DDD
 
    var timePatterns = [
        /^([0-9]{2}(?:\.[0-9]*)?)$/,                      // HH.hh
        /^([0-9]{2}):?([0-9]{2}(?:\.[0-9]*)?)$/,          // HH:MM.mm
        /^([0-9]{2}):?([0-9]{2}):?([0-9]{2}(\.[0-9]*)?)$/ // HH:MM:SS.ss
    ];
 
    var DATE_TIME = /^(.+)T(.+)$/;
    var TIME_ZONE = /^(.+)([+\-])([0-9]{2}):?([0-9]{2})$/;
 
    function matchAll(str, patterns) {
        var match;
        var found = some(patterns, function(pattern) {
            return !!(match = pattern.exec(str));
        });
 
        return found ? match : null;
    }
 
    function getDate(year, month, day) {
        var date = new Date(Date.UTC(year, month, day));
 
        // Explicitly set year to avoid Date.UTC making dates < 100 relative to
        // 1900
        date.setUTCFullYear(year);
 
        var valid =
            date.getUTCFullYear() === year &&
            date.getUTCMonth() === month &&
            date.getUTCDate() === day;
        return valid ? +date : NaN;
    }
 
    function parseOrdinalDate(str) {
        var match = ORD_DATE.exec(str);
        if (match ) {
            var year = +match[1],
                day = +match[2],
                date = new Date(Date.UTC(year, 0, day));
 
            if (date.getUTCFullYear() === year) {
                return +date;
            }
        }
 
        return NaN;
    }
 
    function parseDate(str) {
        var match, year, month, day;
 
        match = matchAll(str, datePatterns);
        if (match === null) {
            // Ordinal dates are verified differently.
            return parseOrdinalDate(str);
        }
 
        year = (match[1] === void 0) ? 0 : +match[1];
        month = (match[2] === void 0) ? 0 : +match[2] - 1;
        day = (match[3] === void 0) ? 1 : +match[3];
 
        return getDate(year, month, day);
    }
 
    function getTime(hr, min, sec) {
        var valid =
            (hr < 24 && hr >= 0 &&
             min < 60 && min >= 0 &&
             sec < 60 && min >= 0) ||
            (hr === 24 && min === 0 && sec === 0);
        if (!valid) {
            return NaN;
        }
 
        return ((hr * 60 + min) * 60 + sec) * 1000;
    }
 
    function parseOffset(str) {
        var match;
        if (str.charAt(str.length - 1) === 'Z') {
            str = str.substring(0, str.length - 1);
        } else {
            match = TIME_ZONE.exec(str);
            if (match) {
                var hours = +match[3],
                    minutes = (match[4] === void 0) ? 0 : +match[4],
                    offset = getTime(hours, minutes, 0);
 
                if (match[2] === '-') {
                    offset *= -1;
                }
 
                return { offset: offset, time: match[1] };
            }
        }
 
        // No time zone specified, assume UTC
        return { offset: 0, time: str };
    }
 
    function parseTime(str) {
        var match;
        var offset = parseOffset(str);
 
        str = offset.time;
        offset = offset.offset;
        if (isNaN(offset)) {
            return NaN;
        }
 
        match = matchAll(str, timePatterns);
        if (match === null) {
            return NaN;
        }
 
        var hours = (match[1] === void 0) ? 0 : +match[1],
            minutes = (match[2] === void 0) ? 0 : +match[2],
            seconds = (match[3] === void 0) ? 0 : +match[3];
 
        return getTime(hours, minutes, seconds) - offset;
    }
 
    /**
     * Parse an ISO8601 formatted date string, and return a Date object.
     */
    function parseISO8601(str){
        var match = DATE_TIME.exec(str);
        if (!match) {
            // No time specified
            return parseDate(str);
        }
 
        return parseDate(match[1]) + parseTime(match[2]);
    }
 
    module.exports = parseISO8601;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/quarter.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/quarter.js

Statements: 20% (2 / 10)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18          1               1        
 
 
    /**
     * gets date quarter
     */
    function quarter(date){
        var month = date.getMonth();
        if (month < 3) return 1;
        if (month < 6) return 2;
        if (month < 9) return 3;
        return 4;
    }
 
    module.exports = quarter;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/startOf.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/startOf.js

Statements: 14.29% (3 / 21)      Branches: 0% (0 / 14)      Functions: 0% (0 / 1)      Lines: 14.29% (3 / 21)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 561         1                                                                                           1        
var clone = require('../lang/clone');
 
    /**
     * get a new Date object representing start of period
     */
    function startOf(date, period){
        date = clone(date);
 
        // intentionally removed "break" from switch since start of
        // month/year/etc should also reset the following periods
        switch (period) {
            case 'year':
                date.setMonth(0);
            /* falls through */
            case 'month':
                date.setDate(1);
            /* falls through */
            case 'week':
            case 'day':
                date.setHours(0);
            /* falls through */
            case 'hour':
                date.setMinutes(0);
            /* falls through */
            case 'minute':
                date.setSeconds(0);
            /* falls through */
            case 'second':
                date.setMilliseconds(0);
                break;
            default:
                throw new Error('"'+ period +'" is not a valid period');
        }
 
        // week is the only case that should reset the weekDay and maybe even
        // overflow to previous month
        if (period === 'week') {
            var weekDay = date.getDay();
            var baseDate = date.getDate();
            if (weekDay) {
                if (weekDay >= baseDate) {
                    //start of the week is on previous month
                    date.setDate(0);
                }
                date.setDate(date.getDate() - date.getDay());
            }
        }
 
        return date;
    }
 
    module.exports = startOf;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/strftime.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/strftime.js

Statements: 24.07% (13 / 54)      Branches: 0% (0 / 41)      Functions: 0% (0 / 5)      Lines: 24.07% (13 / 54)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 1231 1 1 1 1 1 1   1                             1       1                       1                   1                                                                                                                                         1        
var pad = require('../number/pad');
var lpad = require('../string/lpad');
var i18n = require('./i18n_');
var dayOfTheYear = require('./dayOfTheYear');
var timezoneOffset = require('./timezoneOffset');
var timezoneAbbr = require('./timezoneAbbr');
var weekOfTheYear = require('./weekOfTheYear');
 
    var _combinations = {
        'D': '%m/%d/%y',
        'F': '%Y-%m-%d',
        'r': '%I:%M:%S %p',
        'R': '%H:%M',
        'T': '%H:%M:%S',
        'x': 'locale',
        'X': 'locale',
        'c': 'locale'
    };
 
 
    /**
     * format date based on strftime format
     */
    function strftime(date, format, localeData){
        localeData = localeData  || i18n;
        var reToken = /%([a-z%])/gi;
 
        function makeIterator(fn) {
            return function(match, token){
                return fn(date, token, localeData);
            };
        }
 
        return format
            .replace(reToken, makeIterator(expandCombinations))
            .replace(reToken, makeIterator(convertToken));
    }
 
 
    function expandCombinations(date, token, l10n){
        if (token in _combinations) {
            var expanded = _combinations[token];
            return expanded === 'locale'? l10n[token] : expanded;
        } else {
            return '%'+ token;
        }
    }
 
 
    function convertToken(date, token, l10n){
        switch (token){
            case 'a':
                return l10n.days_abbr[date.getDay()];
            case 'A':
                return l10n.days[date.getDay()];
            case 'h':
            case 'b':
                return l10n.months_abbr[date.getMonth()];
            case 'B':
                return l10n.months[date.getMonth()];
            case 'C':
                return pad(Math.floor(date.getFullYear() / 100), 2);
            case 'd':
                return pad(date.getDate(), 2);
            case 'e':
                return pad(date.getDate(), 2, ' ');
            case 'H':
                return pad(date.getHours(), 2);
            case 'I':
                return pad(date.getHours() % 12, 2);
            case 'j':
                return pad(dayOfTheYear(date), 3);
            case 'l':
                return lpad(date.getHours() % 12, 2);
            case 'L':
                return pad(date.getMilliseconds(), 3);
            case 'm':
                return pad(date.getMonth() + 1, 2);
            case 'M':
                return pad(date.getMinutes(), 2);
            case 'n':
                return '\n';
            case 'p':
                return date.getHours() >= 12? l10n.pm : l10n.am;
            case 'P':
                return convertToken(date, 'p', l10n).toLowerCase();
            case 's':
                return date.getTime() / 1000;
            case 'S':
                return pad(date.getSeconds(), 2);
            case 't':
                return '\t';
            case 'u':
                var day = date.getDay();
                return day === 0? 7 : day;
            case 'U':
                return pad(weekOfTheYear(date), 2);
            case 'w':
                return date.getDay();
            case 'W':
                return pad(weekOfTheYear(date, 1), 2);
            case 'y':
                return pad(date.getFullYear() % 100, 2);
            case 'Y':
                return pad(date.getFullYear(), 4);
            case 'z':
                return timezoneOffset(date);
            case 'Z':
                return timezoneAbbr(date);
            case '%':
                return '%';
            default:
                // keep unrecognized tokens
                return '%'+ token;
        }
    }
 
 
    module.exports = strftime;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/timezoneAbbr.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/timezoneAbbr.js

Statements: 60% (3 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191         1                 1        
var timezoneOffset = require('./timezoneOffset');
 
    /**
     * Abbreviated time zone name or similar information.
     */
    function timezoneAbbr(date){
        // Date.toString gives different results depending on the
        // browser/system so we fallback to timezone offset
        // chrome: 'Mon Apr 08 2013 09:02:04 GMT-0300 (BRT)'
        // IE: 'Mon Apr 8 09:02:04 UTC-0300 2013'
        var tz = /\(([A-Z]{3,4})\)/.exec(date.toString());
        return tz? tz[1] : timezoneOffset(date);
    }
 
    module.exports = timezoneAbbr;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/timezoneOffset.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/timezoneOffset.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var pad = require('../number/pad');
 
    /**
     * time zone as hour and minute offset from UTC (e.g. +0900)
     */
    function timezoneOffset(date){
        var offset = date.getTimezoneOffset();
        var abs = Math.abs(offset);
        var h = pad(Math.floor(abs / 60), 2);
        var m = pad(abs % 60, 2);
        return (offset > 0? '-' : '+') + h + m;
    }
 
    module.exports = timezoneOffset;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/totalDaysInMonth.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/totalDaysInMonth.js

Statements: 50% (5 / 10)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 50% (5 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1   1         1                       1        
var isDate = require('../lang/isDate');
var isLeapYear = require('./isLeapYear');
 
    var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
 
    /**
     * returns the total amount of days in the month (considering leap years)
     */
    function totalDaysInMonth(fullYear, monthIndex){
        if (isDate(fullYear)) {
            monthIndex = fullYear.getMonth();
        }
 
        if (monthIndex === 1 && isLeapYear(fullYear)) {
            return 29;
        } else {
            return DAYS_IN_MONTH[monthIndex];
        }
    }
 
    module.exports = totalDaysInMonth;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/totalDaysInYear.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/totalDaysInYear.js

Statements: 75% (3 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151           1       1        
var isLeapYear = require('./isLeapYear');
 
    /**
     * return the amount of days in the year following the gregorian calendar
     * and leap years
     */
    function totalDaysInYear(fullYear){
        return isLeapYear(fullYear)? 366 : 365;
    }
 
    module.exports = totalDaysInYear;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/weekOfTheYear.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/weekOfTheYear.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var dayOfTheYear = require('./dayOfTheYear');
 
    /**
     * Return the week of the year based on given firstDayOfWeek
     */
    function weekOfTheYear(date, firstDayOfWeek){
        firstDayOfWeek = firstDayOfWeek == null? 0 : firstDayOfWeek;
        var doy = dayOfTheYear(date);
        var dow = (7 + date.getDay() - firstDayOfWeek) % 7;
        var relativeWeekDay = 6 - firstDayOfWeek - dow;
        return Math.floor((doy + relativeWeekDay) / 7);
    }
 
    module.exports = weekOfTheYear;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/i18n/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/i18n/

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/i18n/
File Statements Branches Functions Lines
en-US.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/i18n/en-US.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/date/i18n/en-US.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63    1                                                                                                                        
 
    // en-US (English, United States)
    module.exports = {
        "am" : "AM",
        "pm" : "PM",
 
        "x": "%m/%d/%y",
        "X": "%H:%M:%S",
        "c": "%a %d %b %Y %I:%M:%S %p %Z",
 
        "months" : [
            "January",
            "February",
            "March",
            "April",
            "May",
            "June",
            "July",
            "August",
            "September",
            "October",
            "November",
            "December"
        ],
 
        "months_abbr" : [
            "Jan",
            "Feb",
            "Mar",
            "Apr",
            "May",
            "Jun",
            "Jul",
            "Aug",
            "Sep",
            "Oct",
            "Nov",
            "Dec"
        ],
 
        "days" : [
            "Sunday",
            "Monday",
            "Tuesday",
            "Wednesday",
            "Thursday",
            "Friday",
            "Saturday"
        ],
 
        "days_abbr" : [
            "Sun",
            "Mon",
            "Tue",
            "Wed",
            "Thu",
            "Fri",
            "Sat"
        ]
    };
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/

Statements: 36.8% (46 / 125)      Branches: 0% (0 / 22)      Functions: 0% (0 / 32)      Lines: 36.8% (46 / 125)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/
File Statements Branches Functions Lines
awaitDelay.js 55.56% (5 / 9) 100% (0 / 0) 0% (0 / 2) 55.56% (5 / 9)
bind.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 2) 50% (3 / 6)
compose.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 2) 25% (2 / 8)
constant.js 50% (2 / 4) 100% (0 / 0) 0% (0 / 2) 50% (2 / 4)
debounce.js 22.22% (4 / 18) 0% (0 / 6) 0% (0 / 4) 22.22% (4 / 18)
func.js 50% (2 / 4) 100% (0 / 0) 0% (0 / 2) 50% (2 / 4)
identity.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
makeIterator_.js 38.46% (5 / 13) 0% (0 / 8) 0% (0 / 3) 38.46% (5 / 13)
partial.js 36.36% (4 / 11) 0% (0 / 2) 0% (0 / 2) 36.36% (4 / 11)
prop.js 50% (2 / 4) 100% (0 / 0) 0% (0 / 2) 50% (2 / 4)
series.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 2) 25% (2 / 8)
throttle.js 23.81% (5 / 21) 0% (0 / 4) 0% (0 / 4) 23.81% (5 / 21)
timeout.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 2) 50% (3 / 6)
times.js 33.33% (2 / 6) 0% (0 / 2) 0% (0 / 1) 33.33% (2 / 6)
wrap.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/awaitDelay.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/awaitDelay.js

Statements: 55.56% (5 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 55.56% (5 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241 1 1         1                       1        
var now = require('../time/now');
var timeout = require('./timeout');
var append = require('../array/append');
 
    /**
     * Ensure a minimum delay for callbacks
     */
    function awaitDelay( callback, delay ){
        var baseTime = now() + delay;
        return function() {
            // ensure all browsers will execute it asynchronously (avoid hard
            // to catch errors) not using "0" because of old browsers and also
            // since new browsers increase the value to be at least "4"
            // http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout
            var ms = Math.max(baseTime - now(), 4);
            return timeout.apply(this, append([callback, ms, this], arguments));
        };
    }
 
    module.exports = awaitDelay;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/bind.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/bind.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211                 1             1        
var slice = require('../array/slice');
 
    /**
     * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection.
     * @param {Function} fn  Function.
     * @param {object} context   Execution context.
     * @param {rest} args    Arguments (0...n arguments).
     * @return {Function} Wrapped Function.
     */
    function bind(fn, context, args){
        var argsArr = slice(arguments, 2); //curried args
        return function(){
            return fn.apply(context, argsArr.concat(slice(arguments)));
        };
    }
 
    module.exports = bind;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/compose.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/compose.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25            1                           1        
 
 
    /**
     * Returns a function that composes multiple functions, passing results to
     * each other.
     */
    function compose() {
        var fns = arguments;
        return function(arg){
            // only cares about the first argument since the chain can only
            // deal with a single return value anyway. It should start from
            // the last fn.
            var n = fns.length;
            while (n--) {
                arg = fns[n].call(this, arg);
            }
            return arg;
         };
     }
 
     module.exports = compose;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/constant.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/constant.js

Statements: 50% (2 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16          1           1        
 
 
    /**
     * Returns a new function that will return the value
     */
    function constant(value){
        return function() {
            return value;
        };
    }
 
    module.exports = constant;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/debounce.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/debounce.js

Statements: 22.22% (4 / 18)      Branches: 0% (0 / 6)      Functions: 0% (0 / 4)      Lines: 22.22% (4 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34          1   1   1                                       1        
 
 
    /**
     * Debounce callback execution
     */
    function debounce(fn, threshold, isAsap){
        var timeout, result;
        function debounced(){
            var args = arguments, context = this;
            function delayed(){
                if (! isAsap) {
                    result = fn.apply(context, args);
                }
                timeout = null;
            }
            if (timeout) {
                clearTimeout(timeout);
            } else if (isAsap) {
                result = fn.apply(context, args);
            }
            timeout = setTimeout(delayed, threshold);
            return result;
        }
        debounced.cancel = function(){
            clearTimeout(timeout);
        };
        return debounced;
    }
 
    module.exports = debounce;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/func.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/func.js

Statements: 50% (2 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16          1           1        
 
 
    /**
     * Returns a function that call a method on the passed object
     */
    function func(name){
        return function(obj){
            return obj[name]();
        };
    }
 
    module.exports = func;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/identity.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/identity.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14          1       1        
 
 
    /**
     * Returns the first argument provided to it.
     */
    function identity(val){
        return val;
    }
 
    module.exports = identity;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/makeIterator_.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/makeIterator_.js

Statements: 38.46% (5 / 13)      Branches: 0% (0 / 8)      Functions: 0% (0 / 3)      Lines: 38.46% (5 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361 1 1             1                                           1        
var identity = require('./identity');
var prop = require('./prop');
var deepMatches = require('../object/deepMatches');
 
    /**
     * Converts argument into a valid iterator.
     * Used internally on most array/object/collection methods that receives a
     * callback/iterator providing a shortcut syntax.
     */
    function makeIterator(src, thisObj){
        if (src == null) {
            return identity;
        }
        switch(typeof src) {
            case 'function':
                // function is the first to improve perf (most common case)
                // also avoid using `Function#call` if not needed, which boosts
                // perf a lot in some cases
                return (typeof thisObj !== 'undefined')? function(val, i, arr){
                    return src.call(thisObj, val, i, arr);
                } : src;
            case 'object':
                return function(val){
                    return deepMatches(val, src);
                };
            case 'string':
            case 'number':
                return prop(src);
        }
    }
 
    module.exports = makeIterator;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/partial.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/partial.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251         1                         1   1        
var slice = require('../array/slice');
 
    /**
     * Creates a partially applied function.
     */
    function partial(f) {
        var as = slice(arguments, 1);
        return function() {
            var args = as.concat(slice(arguments));
            for (var i = args.length; i--;) {
                if (args[i] === partial._) {
                    args[i] = args.splice(-1)[0];
                }
            }
            return f.apply(this, args);
        };
    }
 
    partial._ = {};
 
    module.exports = partial;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/prop.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/prop.js

Statements: 50% (2 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16          1           1        
 
 
    /**
     * Returns a function that gets a property of the passed object
     */
    function prop(name){
        return function(obj){
            return obj[name];
        };
    }
 
    module.exports = prop;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/series.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/series.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24              1                       1        
 
 
    /**
     * Returns a function that will execute a list of functions in sequence
     * passing the same arguments to each one. (useful for batch processing
     * items during a forEach loop)
     */
    function series(){
        var fns = arguments;
        return function(){
            var i = 0,
                n = fns.length;
            while (i < n) {
                fns[i].apply(this, arguments);
                i += 1;
            }
        };
    }
 
    module.exports = series;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/throttle.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/throttle.js

Statements: 23.81% (5 / 21)      Branches: 0% (0 / 4)      Functions: 0% (0 / 4)      Lines: 23.81% (5 / 21)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351       1     1         1                                   1        
var now = require('../time/now');
 
    /**
     */
    function throttle(fn, delay){
        var context, timeout, result, args,
            diff, prevCall = 0;
        function delayed(){
            prevCall = now();
            timeout = null;
            result = fn.apply(context, args);
        }
        function throttled(){
            context = this;
            args = arguments;
            diff = delay - (now() - prevCall);
            if (diff <= 0) {
                clearTimeout(timeout);
                delayed();
            } else if (! timeout) {
                timeout = setTimeout(delayed, diff);
            }
            return result;
        }
        throttled.cancel = function(){
            clearTimeout(timeout);
        };
        return throttled;
    }
 
    module.exports = throttle;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/timeout.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/timeout.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191         1                 1        
var slice = require('../array/slice');
 
    /**
     * Delays the call of a function within a given context.
     */
    function timeout(fn, millis, context){
 
        var args = slice(arguments, 3);
 
        return setTimeout(function() {
            fn.apply(context, args);
        }, millis);
    }
 
    module.exports = timeout;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/times.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/times.js

Statements: 33.33% (2 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 33.33% (2 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19          1                 1        
 
 
    /**
     * Iterates over a callback a set amount of times
     */
    function times(n, callback, thisObj){
        var i = -1;
        while (++i < n) {
            if ( callback.call(thisObj, i) === false ) {
                break;
            }
        }
    }
 
    module.exports = times;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/wrap.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/function/wrap.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161             1       1        
var partial = require('./partial');
 
    /**
     * Returns the first function passed as an argument to the second,
     * allowing you to adjust arguments, run code before and after, and
     * conditionally execute the original function.
     */
    function wrap(fn, wrapper){
        return partial(wrapper, fn);
    }
 
    module.exports = wrap;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/

Statements: 50.88% (116 / 228)      Branches: 4.35% (4 / 92)      Functions: 4.55% (2 / 44)      Lines: 51.79% (116 / 224)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/
File Statements Branches Functions Lines
GLOBAL.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
clone.js 36% (9 / 25) 0% (0 / 13) 0% (0 / 5) 36% (9 / 25)
createObject.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 2) 66.67% (4 / 6)
ctorApply.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
deepClone.js 33.33% (8 / 24) 0% (0 / 7) 0% (0 / 4) 33.33% (8 / 24)
deepEquals.js 50% (8 / 16) 0% (0 / 13) 0% (0 / 2) 50% (8 / 16)
defaults.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 2) 71.43% (5 / 7)
inheritPrototype.js 37.5% (3 / 8) 100% (0 / 0) 0% (0 / 1) 37.5% (3 / 8)
is.js 40% (2 / 5) 0% (0 / 6) 0% (0 / 1) 40% (2 / 5)
isArguments.js 60% (3 / 5) 25% (1 / 4) 0% (0 / 2) 60% (3 / 5)
isArray.js 75% (3 / 4) 50% (1 / 2) 0% (0 / 1) 75% (3 / 4)
isBoolean.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isDate.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isEmpty.js 26.67% (4 / 15) 0% (0 / 8) 0% (0 / 2) 26.67% (4 / 15)
isFinite.js 40% (4 / 10) 0% (0 / 6) 0% (0 / 1) 40% (4 / 10)
isFunction.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isInteger.js 75% (3 / 4) 0% (0 / 2) 0% (0 / 1) 75% (3 / 4)
isKind.js 100% (4 / 4) 100% (0 / 0) 100% (1 / 1) 100% (4 / 4)
isNaN.js 80% (4 / 5) 0% (0 / 2) 0% (0 / 1) 80% (4 / 5)
isNull.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
isNumber.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isObject.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isPlainObject.js 66.67% (2 / 3) 0% (0 / 3) 0% (0 / 1) 66.67% (2 / 3)
isPrimitive.js 40% (2 / 5) 0% (0 / 3) 0% (0 / 1) 40% (2 / 5)
isRegExp.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isString.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isUndefined.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
isnt.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
kindOf.js 75% (6 / 8) 50% (2 / 4) 100% (1 / 1) 75% (6 / 8)
toArray.js 33.33% (4 / 12) 0% (0 / 9) 0% (0 / 1) 33.33% (4 / 12)
toNumber.js 25% (3 / 12) 0% (0 / 8) 0% (0 / 1) 37.5% (3 / 8)
toString.js 66.67% (2 / 3) 0% (0 / 2) 0% (0 / 1) 66.67% (2 / 3)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/GLOBAL.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/GLOBAL.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9        1        
 
 
    // Reference to the global context (works on ES3 and ES5-strict mode)
    //jshint -W061, -W064
    module.exports = Function('return this')();
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/clone.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/clone.js

Statements: 36% (9 / 25)      Branches: 0% (0 / 13)      Functions: 0% (0 / 5)      Lines: 36% (9 / 25)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 511 1 1         1                             1               1               1       1       1        
var kindOf = require('./kindOf');
var isPlainObject = require('./isPlainObject');
var mixIn = require('../object/mixIn');
 
    /**
     * Clone native types.
     */
    function clone(val){
        switch (kindOf(val)) {
            case 'Object':
                return cloneObject(val);
            case 'Array':
                return cloneArray(val);
            case 'RegExp':
                return cloneRegExp(val);
            case 'Date':
                return cloneDate(val);
            default:
                return val;
        }
    }
 
    function cloneObject(source) {
        if (isPlainObject(source)) {
            return mixIn({}, source);
        } else {
            return source;
        }
    }
 
    function cloneRegExp(r) {
        var flags = '';
        flags += r.multiline ? 'm' : '';
        flags += r.global ? 'g' : '';
        flags += r.ignoreCase ? 'i' : '';
        return new RegExp(r.source, flags);
    }
 
    function cloneDate(date) {
        return new Date(+date);
    }
 
    function cloneArray(arr) {
        return arr.slice();
    }
 
    module.exports = clone;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/createObject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/createObject.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201                 1 1         1        
var mixIn = require('../object/mixIn');
 
    /**
     * Create Object using prototypal inheritance and setting custom properties.
     * - Mix between Douglas Crockford Prototypal Inheritance <http://javascript.crockford.com/prototypal.html> and the EcmaScript 5 `Object.create()` method.
     * @param {object} parent    Parent Object.
     * @param {object} [props] Object properties.
     * @return {object} Created object.
     */
    function createObject(parent, props){
        function F(){}
        F.prototype = parent;
        return mixIn(new F(), props);
 
    }
    module.exports = createObject;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/ctorApply.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/ctorApply.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19    1         1             1        
 
 
    function F(){}
 
    /**
     * Do fn.apply on a constructor.
     */
    function ctorApply(ctor, args) {
        F.prototype = ctor.prototype;
        var instance = new F();
        ctor.apply(instance, args);
        return instance;
    }
 
    module.exports = ctorApply;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/deepClone.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/deepClone.js

Statements: 33.33% (8 / 24)      Branches: 0% (0 / 7)      Functions: 0% (0 / 4)      Lines: 33.33% (8 / 24)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 501 1 1 1         1                     1                           1                     1          
var clone = require('./clone');
var forOwn = require('../object/forOwn');
var kindOf = require('./kindOf');
var isPlainObject = require('./isPlainObject');
 
    /**
     * Recursively clone native types.
     */
    function deepClone(val, instanceClone) {
        switch ( kindOf(val) ) {
            case 'Object':
                return cloneObject(val, instanceClone);
            case 'Array':
                return cloneArray(val, instanceClone);
            default:
                return clone(val);
        }
    }
 
    function cloneObject(source, instanceClone) {
        if (isPlainObject(source)) {
            var out = {};
            forOwn(source, function(val, key) {
                this[key] = deepClone(val, instanceClone);
            }, out);
            return out;
        } else if (instanceClone) {
            return instanceClone(source);
        } else {
            return source;
        }
    }
 
    function cloneArray(arr, instanceClone) {
        var out = [],
            i = -1,
            n = arr.length,
            val;
        while (++i < n) {
            out[i] = deepClone(arr[i], instanceClone);
        }
        return out;
    }
 
    module.exports = deepClone;
 
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/deepEquals.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/deepEquals.js

Statements: 50% (8 / 16)      Branches: 0% (0 / 13)      Functions: 0% (0 / 2)      Lines: 50% (8 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1 1 1 1         1                   1               1        
var is = require('./is');
var isObject = require('./isObject');
var isArray = require('./isArray');
var objEquals = require('../object/equals');
var arrEquals = require('../array/equals');
 
    /**
     * Recursively checks for same properties and values.
     */
    function deepEquals(a, b, callback){
        callback = callback || is;
 
        var bothObjects = isObject(a) && isObject(b);
        var bothArrays = !bothObjects && isArray(a) && isArray(b);
 
        if (!bothObjects && !bothArrays) {
            return callback(a, b);
        }
 
        function compare(a, b){
            return deepEquals(a, b, callback);
        }
 
        var method = bothObjects ? objEquals : arrEquals;
        return method(a, b, compare);
    }
 
    module.exports = deepEquals;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/defaults.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/defaults.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191 1         1       1       1        
var toArray = require('./toArray');
var find = require('../array/find');
 
    /**
     * Return first non void argument
     */
    function defaults(var_args){
        return find(toArray(arguments), nonVoid);
    }
 
    function nonVoid(val){
        return val != null;
    }
 
    module.exports = defaults;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/inheritPrototype.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/inheritPrototype.js

Statements: 37.5% (3 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201               1               1      
var createObject = require('./createObject');
 
    /**
    * Inherit prototype from another Object.
    * - inspired by Nicholas Zackas <http://nczonline.net> Solution
    * @param {object} child Child object
    * @param {object} parent    Parent Object
    */
    function inheritPrototype(child, parent){
        var p = createObject(parent.prototype);
        p.constructor = child;
        child.prototype = p;
        child.super_ = parent;
        return p;
    }
 
    module.exports = inheritPrototype;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/is.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/is.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25          1                             1        
 
 
    /**
     * Check if both arguments are egal.
     */
    function is(x, y){
        // implementation borrowed from harmony:egal spec
        if (x === y) {
          // 0 === -0, but they are not identical
          return x !== 0 || 1 / x === 1 / y;
        }
 
        // NaN !== NaN, but they are identical.
        // NaNs are the only non-reflexive value, i.e., if x !== x,
        // then x is a NaN.
        // isNaN is broken: it converts its argument to number, so
        // isNaN("foo") => true
        return x !== x && y !== y;
    }
 
    module.exports = is;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isArguments.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isArguments.js

Statements: 60% (3 / 5)      Branches: 25% (1 / 4)      Functions: 0% (0 / 2)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171       1                 1      
var isKind = require('./isKind');
 
    /**
     */
    var isArgs = isKind(arguments, 'Arguments')?
            function(val){
                return isKind(val, 'Arguments');
            } :
            function(val){
                // Arguments is an Object on IE7
                return !!(val && Object.prototype.hasOwnProperty.call(val, 'callee'));
            };
 
    module.exports = isArgs;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isArray.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isArray.js

Statements: 75% (3 / 4)      Branches: 50% (1 / 2)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    var isArray = Array.isArray || function (val) {
        return isKind(val, 'Array');
    };
    module.exports = isArray;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isBoolean.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isBoolean.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isBoolean(val) {
        return isKind(val, 'Boolean');
    }
    module.exports = isBoolean;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isDate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isDate.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isDate(val) {
        return isKind(val, 'Date');
    }
    module.exports = isDate;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isEmpty.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isEmpty.js

Statements: 26.67% (4 / 15)      Branches: 0% (0 / 8)      Functions: 0% (0 / 2)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1   1                                   1        
var forOwn = require('../object/forOwn');
var isArray = require('./isArray');
 
    function isEmpty(val){
        if (val == null) {
            // typeof null == 'object' so we check it first
            return true;
        } else if ( typeof val === 'string' || isArray(val) ) {
            return !val.length;
        } else if ( typeof val === 'object' ) {
            var result = true;
            forOwn(val, function(){
                result = false;
                return false; // break loop
            });
            return result;
        } else {
            return true;
        }
    }
 
    module.exports = isEmpty;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isFinite.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isFinite.js

Statements: 40% (4 / 10)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 40% (4 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1         1                     1        
var isNumber = require('./isNumber');
var GLOBAL = require('./GLOBAL');
 
    /**
     * Check if value is finite
     */
    function isFinite(val){
        var is = false;
        if (typeof val === 'string' && val !== '') {
            is = GLOBAL.isFinite( parseFloat(val) );
        } else if (isNumber(val)){
            // need to use isNumber because of Number constructor
            is = GLOBAL.isFinite( val );
        }
        return is;
    }
 
    module.exports = isFinite;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isFunction.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isFunction.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isFunction(val) {
        return isKind(val, 'Function');
    }
    module.exports = isFunction;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isInteger.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isInteger.js

Statements: 75% (3 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1       1        
var isNumber = require('./isNumber');
 
    /**
     * Check if value is an integer
     */
    function isInteger(val){
        return isNumber(val) && (val % 1 === 0);
    }
 
    module.exports = isInteger;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isKind.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isKind.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111       1 1   1      
var kindOf = require('./kindOf');
    /**
     * Check if value is from a specific "kind".
     */
    function isKind(val, kind){
        return kindOf(val) === kind;
    }
    module.exports = isKind;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isNaN.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isNaN.js

Statements: 80% (4 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1         1             1        
var isNumber = require('./isNumber');
var $isNaN = require('../number/isNaN');
 
    /**
     * Check if value is NaN for realz
     */
    function isNaN(val){
        // based on the fact that NaN !== NaN
        // need to check if it's a number to avoid conflicts with host objects
        // also need to coerce ToNumber to avoid edge case `new Number(NaN)`
        return !isNumber(val) || $isNaN(Number(val));
    }
 
    module.exports = isNaN;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isNull.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isNull.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11      1     1        
 
    /**
     */
    function isNull(val){
        return val === null;
    }
    module.exports = isNull;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isNumber.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isNumber.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isNumber(val) {
        return isKind(val, 'Number');
    }
    module.exports = isNumber;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isObject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isObject.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isObject(val) {
        return isKind(val, 'Object');
    }
    module.exports = isObject;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isPlainObject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isPlainObject.js

Statements: 66.67% (2 / 3)      Branches: 0% (0 / 3)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15          1         1        
 
 
    /**
     * Checks if the value is created by the `Object` constructor.
     */
    function isPlainObject(value) {
        return (!!value && typeof value === 'object' &&
            value.constructor === Object);
    }
 
    module.exports = isPlainObject;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isPrimitive.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isPrimitive.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 3)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23          1                         1        
 
 
    /**
     * Checks if the object is a primitive
     */
    function isPrimitive(value) {
        // Using switch fallthrough because it's simple to read and is
        // generally fast: http://jsperf.com/testing-value-is-primitive/5
        switch (typeof value) {
            case "string":
            case "number":
            case "boolean":
                return true;
        }
 
        return value == null;
    }
 
    module.exports = isPrimitive;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isRegExp.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isRegExp.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isRegExp(val) {
        return isKind(val, 'RegExp');
    }
    module.exports = isRegExp;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isString.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isString.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 101     1     1      
var isKind = require('./isKind');
    /**
     */
    function isString(val) {
        return isKind(val, 'String');
    }
    module.exports = isString;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isUndefined.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isUndefined.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12  1       1     1      
 
    var UNDEF;
 
    /**
     */
    function isUndef(val){
        return val === UNDEF;
    }
    module.exports = isUndef;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isnt.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/isnt.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1       1        
var is = require('./is');
 
    /**
     * Check if both values are not identical/egal
     */
    function isnt(x, y){
        return !is(x, y);
    }
 
    module.exports = isnt;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/kindOf.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/kindOf.js

Statements: 75% (6 / 8)      Branches: 50% (2 / 4)      Functions: 100% (1 / 1)      Lines: 75% (6 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22    1             1 1   1     1     1      
 
 
    var _rKind = /^\[object (.*)\]$/,
        _toString = Object.prototype.toString,
        UNDEF;
 
    /**
     * Gets the "kind" of value. (e.g. "String", "Number", etc)
     */
    function kindOf(val) {
        Iif (val === null) {
            return 'Null';
        } else Iif (val === UNDEF) {
            return 'Undefined';
        } else {
            return _rKind.exec( _toString.call(val) )[1];
        }
    }
    module.exports = kindOf;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/toArray.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/toArray.js

Statements: 33.33% (4 / 12)      Branches: 0% (0 / 9)      Functions: 0% (0 / 1)      Lines: 33.33% (4 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1         1                                           1      
var kindOf = require('./kindOf');
var GLOBAL = require('./GLOBAL');
 
    /**
     * Convert array-like object into array
     */
    function toArray(val){
        var ret = [],
            kind = kindOf(val),
            n;
 
        if (val != null) {
            if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === GLOBAL ) {
                //string, regexp, function have .length but user probably just want
                //to wrap value into an array..
                ret[ret.length] = val;
            } else {
                //window returns true on isObject in IE7 and may have length
                //property. `typeof NodeList` returns `function` on Safari so
                //we can't use it (#58)
                n = val.length;
                while (n--) {
                    ret[n] = val[n];
                }
            }
        }
        return ret;
    }
    module.exports = toArray;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/toNumber.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/toNumber.js

Statements: 25% (3 / 12)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221         1                       1        
var isArray = require('./isArray');
 
    /**
     * covert value into number if numeric
     */
    function toNumber(val){
        // numberic values should come first because of -0
        if (typeof val === 'number') return val;
        // we want all falsy values (besides -0) to return zero to avoid
        // headaches
        if (!val) return 0;
        if (typeof val === 'string') return parseFloat(val);
        // arrays are edge cases. `Number([4]) === 4`
        if (isArray(val)) return NaN;
        return Number(val);
    }
 
    module.exports = toNumber;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/toString.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/lang/toString.js

Statements: 66.67% (2 / 3)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15            1       1        
 
 
    /**
     * Typecast a value to a String, using an empty string value for null or
     * undefined.
     */
    function toString(val){
        return val == null ? '' : val.toString();
    }
 
    module.exports = toString;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/

Statements: 54.55% (24 / 44)      Branches: 0% (0 / 26)      Functions: 0% (0 / 11)      Lines: 54.55% (24 / 44)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/
File Statements Branches Functions Lines
ceil.js 50% (2 / 4) 0% (0 / 2) 0% (0 / 1) 50% (2 / 4)
clamp.js 66.67% (2 / 3) 0% (0 / 4) 0% (0 / 1) 66.67% (2 / 3)
countSteps.js 33.33% (2 / 6) 0% (0 / 2) 0% (0 / 1) 33.33% (2 / 6)
floor.js 50% (2 / 4) 0% (0 / 2) 0% (0 / 1) 50% (2 / 4)
inRange.js 50% (2 / 4) 0% (0 / 4) 0% (0 / 1) 50% (2 / 4)
isNear.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
lerp.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
loop.js 66.67% (2 / 3) 0% (0 / 4) 0% (0 / 1) 66.67% (2 / 3)
map.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
norm.js 40% (2 / 5) 0% (0 / 6) 0% (0 / 1) 40% (2 / 5)
round.js 50% (2 / 4) 0% (0 / 2) 0% (0 / 1) 50% (2 / 4)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/ceil.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/ceil.js

Statements: 50% (2 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13        1         1      
 
    /**
     * Round value up with a custom radix.
     */
    function ceil(val, step){
        step = Math.abs(step || 1);
        return Math.ceil(val / step) * step;
    }
 
    module.exports = ceil;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/clamp.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/clamp.js

Statements: 66.67% (2 / 3)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11        1     1      
 
    /**
     * Clamps value inside range.
     */
    function clamp(val, min, max){
        return val < min? min : (val > max? max : val);
    }
    module.exports = clamp;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/countSteps.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/countSteps.js

Statements: 33.33% (2 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 33.33% (2 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18        1                   1      
 
    /**
    * Count number of full steps.
    */
    function countSteps(val, step, overflow){
        val = Math.floor(val / step);
 
        if (overflow) {
            return val % overflow;
        }
 
        return val;
    }
 
    module.exports = countSteps;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/floor.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/floor.js

Statements: 50% (2 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12        1       1      
 
    /**
    * Floor value to full steps.
    */
    function floor(val, step){
        step = Math.abs(step || 1);
        return Math.floor(val / step) * step;
    }
    module.exports = floor;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/inRange.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/inRange.js

Statements: 50% (2 / 4)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13        1         1      
 
    /**
    * Checks if value is inside the range.
    */
    function inRange(val, min, max, threshold){
        threshold = threshold || 0;
        return (val + threshold >= min && val - threshold <= max);
    }
 
    module.exports = inRange;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/isNear.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/isNear.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11        1     1      
 
    /**
    * Check if value is close to target.
    */
    function isNear(val, target, threshold){
        return (Math.abs(val - target) <= threshold);
    }
    module.exports = isNear;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/lerp.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/lerp.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13          1       1      
 
    /**
    * Linear interpolation.
    * IMPORTANT:will return `Infinity` if numbers overflow Number.MAX_VALUE
    */
    function lerp(ratio, start, end){
        return start + (end - start) * ratio;
    }
 
    module.exports = lerp;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/loop.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/loop.js

Statements: 66.67% (2 / 3)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12        1       1      
 
    /**
    * Loops value inside range.
    */
    function loop(val, min, max){
        return val < min? max : (val > max? min : val);
    }
 
    module.exports = loop;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/map.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/map.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1         1     1      
var lerp = require('./lerp');
var norm = require('./norm');
    /**
    * Maps a number from one scale to another.
    * @example map(3, 0, 4, -1, 1) -> 0.5
    */
    function map(val, min1, max1, min2, max2){
        return lerp( norm(val, min1, max1), min2, max2 );
    }
    module.exports = map;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/norm.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/norm.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15        1             1      
 
    /**
    * Gets normalized ratio of value inside range.
    */
    function norm(val, min, max){
        if (val < min || val > max) {
            throw new RangeError('value (' + val + ') must be between ' + min + ' and ' + max);
        }
 
        return val === max ? 1 : (val - min) / (max - min);
    }
    module.exports = norm;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/round.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/math/round.js

Statements: 50% (2 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14        1         1        
 
    /**
     * Round number to a specific radix
     */
    function round(value, radix){
        radix = radix || 1; // default round 1
        return Math.round(value / radix) * radix;
    }
 
    module.exports = round;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/

Statements: 45.98% (40 / 87)      Branches: 0% (0 / 44)      Functions: 0% (0 / 13)      Lines: 47.06% (40 / 85)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/
File Statements Branches Functions Lines
MAX_INT.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
MAX_SAFE_INTEGER.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
MAX_UINT.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
MIN_INT.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
abbreviate.js 25% (4 / 16) 0% (0 / 12) 0% (0 / 1) 25% (4 / 16)
currencyFormat.js 27.27% (3 / 11) 0% (0 / 10) 0% (0 / 1) 27.27% (3 / 11)
enforcePrecision.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 1) 50% (3 / 6)
isNaN.js 66.67% (2 / 3) 0% (0 / 2) 0% (0 / 1) 66.67% (2 / 3)
nth.js 20% (2 / 10) 0% (0 / 8) 0% (0 / 1) 20% (2 / 10)
ordinal.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
pad.js 66.67% (4 / 6) 0% (0 / 2) 0% (0 / 1) 66.67% (4 / 6)
rol.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
ror.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
sign.js 33.33% (3 / 9) 0% (0 / 6) 0% (0 / 1) 42.86% (3 / 7)
toInt.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
toUInt.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
toUInt31.js 75% (3 / 4) 0% (0 / 4) 0% (0 / 1) 75% (3 / 4)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/MAX_INT.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/MAX_INT.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8        1      
/**
 * @constant Maximum 32-bit signed integer value. (2^31 - 1)
 */
 
    module.exports = 2147483647;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/MAX_SAFE_INTEGER.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/MAX_SAFE_INTEGER.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9        1        
 
 
    // maximum safe integer (Math.pow(2, 53) - 1)
    // see: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer
    module.exports = 9007199254740991;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/MAX_UINT.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/MAX_UINT.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8        1      
/**
 * @constant Maximum 32-bit unsigned integet value (2^32 - 1)
 */
 
    module.exports = 4294967295;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/MIN_INT.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/MIN_INT.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8        1      
/**
 * @constant Minimum 32-bit signed integer value (-2^31).
 */
 
    module.exports = -2147483648;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/abbreviate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/abbreviate.js

Statements: 25% (4 / 16)      Branches: 0% (0 / 12)      Functions: 0% (0 / 1)      Lines: 25% (4 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 371   1                 1                                         1        
var enforcePrecision = require('./enforcePrecision');
 
    var _defaultDict = {
        thousand : 'K',
        million : 'M',
        billion : 'B'
    };
 
    /**
     * Abbreviate number if bigger than 1000. (eg: 2.5K, 17.5M, 3.4B, ...)
     */
    function abbreviateNumber(val, nDecimals, dict){
        nDecimals = nDecimals != null? nDecimals : 1;
        dict = dict || _defaultDict;
        val = enforcePrecision(val, nDecimals);
 
        var str, mod;
 
        if (val < 1000000) {
            mod = enforcePrecision(val / 1000, nDecimals);
            // might overflow to next scale during rounding
            str = mod < 1000? mod + dict.thousand : 1 + dict.million;
        } else if (val < 1000000000) {
            mod = enforcePrecision(val / 1000000, nDecimals);
            str = mod < 1000? mod + dict.million : 1 + dict.billion;
        } else {
            str = enforcePrecision(val / 1000000000, nDecimals) + dict.billion;
        }
 
        return str;
    }
 
    module.exports = abbreviateNumber;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/currencyFormat.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/currencyFormat.js

Statements: 27.27% (3 / 11)      Branches: 0% (0 / 10)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291         1                                     1        
var toNumber = require('../lang/toNumber');
 
    /**
     * Converts number into currency format
     */
    function currencyFormat(val, nDecimalDigits, decimalSeparator, thousandsSeparator) {
        val = toNumber(val);
        nDecimalDigits = nDecimalDigits == null? 2 : nDecimalDigits;
        decimalSeparator = decimalSeparator == null? '.' : decimalSeparator;
        thousandsSeparator = thousandsSeparator == null? ',' : thousandsSeparator;
 
        //can't use enforce precision since it returns a number and we are
        //doing a RegExp over the string
        var fixed = val.toFixed(nDecimalDigits),
            //separate begin [$1], middle [$2] and decimal digits [$4]
            parts = new RegExp('^(-?\\d{1,3})((?:\\d{3})+)(\\.(\\d{'+ nDecimalDigits +'}))?$').exec( fixed );
 
        if(parts){ //val >= 1000 || val <= -1000
            return parts[1] + parts[2].replace(/\d{3}/g, thousandsSeparator + '$&') + (parts[4] ? decimalSeparator + parts[4] : '');
        }else{
            return fixed.replace('.', decimalSeparator);
        }
    }
 
    module.exports = currencyFormat;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/enforcePrecision.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/enforcePrecision.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1         1      
var toNumber = require('../lang/toNumber');
    /**
     * Enforce a specific amount of decimal digits and also fix floating
     * point rounding issues.
     */
    function enforcePrecision(val, nDecimalDigits){
        val = toNumber(val);
        var pow = Math.pow(10, nDecimalDigits);
        return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits);
    }
    module.exports = enforcePrecision;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/isNaN.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/isNaN.js

Statements: 66.67% (2 / 3)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16            1         1        
 
 
    /**
     * ES6 Number.isNaN
     * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
     */
    function isNaN(val){
        // jshint eqeqeq:false
        return typeof val === 'number' && val != val;
    }
 
    module.exports = isNaN;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/nth.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/nth.js

Statements: 20% (2 / 10)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27          1                                 1        
 
 
    /**
     * Returns "nth" of number (1 = "st", 2 = "nd", 3 = "rd", 4..10 = "th", ...)
     */
    function nth(i) {
        var t = (i % 100);
        if (t >= 10 && t <= 20) {
            return 'th';
        }
        switch(i % 10) {
            case 1:
                return 'st';
            case 2:
                return 'nd';
            case 3:
                return 'rd';
            default:
                return 'th';
        }
    }
 
    module.exports = nth;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/ordinal.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/ordinal.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1         1         1        
var toInt = require('./toInt');
var nth = require('./nth');
 
    /**
     * converts number into ordinal form (1st, 2nd, 3rd, 4th, ...)
     */
    function ordinal(n){
       n = toInt(n);
       return n + nth(n);
    }
 
    module.exports = ordinal;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/pad.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/pad.js

Statements: 66.67% (4 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1         1         1        
var lpad = require('../string/lpad');
var toNumber = require('../lang/toNumber');
 
    /**
     * Add padding zeros if n.length < minLength.
     */
    function pad(n, minLength, char){
        n = toNumber(n);
        return lpad(''+ n, minLength, char || '0');
    }
 
    module.exports = pad;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/rol.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/rol.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12          1     1      
 
    /**
     * Bitwise circular shift left
     * http://en.wikipedia.org/wiki/Circular_shift
     */
    function rol(val, shift){
        return (val << shift) | (val >> (32 - shift));
    }
    module.exports = rol;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/ror.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/ror.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12          1     1      
 
    /**
     * Bitwise circular shift right
     * http://en.wikipedia.org/wiki/Circular_shift
     */
    function ror(val, shift){
        return (val >> shift) | (val << (32 - shift));
    }
    module.exports = ror;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/sign.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/sign.js

Statements: 33.33% (3 / 9)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171         1             1        
var toNumber = require('../lang/toNumber');
 
    /**
     * Get sign of the value.
     */
    function sign(val) {
        var num = toNumber(val);
        if (num === 0) return num; // +0 and +0 === 0
        if (isNaN(num)) return num; // NaN
        return num < 0? -1 : 1;
    }
 
    module.exports = sign;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/toInt.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/toInt.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                1           1        
 
 
    /**
     * "Convert" value into an 32-bit integer.
     * Works like `Math.floor` if val > 0 and `Math.ceil` if val < 0.
     * IMPORTANT: val will wrap at 2^31 and -2^31.
     * Perf tests: http://jsperf.com/vs-vs-parseint-bitwise-operators/7
     */
    function toInt(val){
        // we do not use lang/toNumber because of perf and also because it
        // doesn't break the functionality
        return ~~val;
    }
 
    module.exports = toInt;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/toUInt.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/toUInt.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17            1           1        
 
 
    /**
     * "Convert" value into a 32-bit unsigned integer.
     * IMPORTANT: Value will wrap at 2^32.
     */
    function toUInt(val){
        // we do not use lang/toNumber because of perf and also because it
        // doesn't break the functionality
        return val >>> 0;
    }
 
    module.exports = toUInt;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/toUInt31.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/number/toUInt31.js

Statements: 75% (3 / 4)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171           1           1        
var MAX_INT = require('./MAX_INT');
 
    /**
     * "Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign).
     * IMPORTANT: value wil wrap at 2^31, if negative will return 0.
     */
    function toUInt31(val){
        // we do not use lang/toNumber because of perf and also because it
        // doesn't break the functionality
        return (val <= 0)? 0 : (val > MAX_INT? ~~(val % (MAX_INT + 1)) : ~~val);
    }
 
    module.exports = toUInt31;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/

Statements: 46.65% (167 / 358)      Branches: 5.83% (7 / 120)      Functions: 11.76% (8 / 68)      Lines: 46.76% (166 / 355)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/
File Statements Branches Functions Lines
bindAll.js 66.67% (6 / 9) 0% (0 / 2) 0% (0 / 2) 66.67% (6 / 9)
contains.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 2) 60% (3 / 5)
deepFillIn.js 26.67% (4 / 15) 0% (0 / 8) 0% (0 / 2) 26.67% (4 / 15)
deepMatches.js 25.93% (7 / 27) 0% (0 / 14) 0% (0 / 5) 25.93% (7 / 27)
deepMixIn.js 33.33% (5 / 15) 0% (0 / 6) 0% (0 / 2) 33.33% (5 / 15)
equals.js 53.33% (8 / 15) 0% (0 / 10) 0% (0 / 4) 53.33% (8 / 15)
every.js 36.36% (4 / 11) 0% (0 / 2) 0% (0 / 2) 36.36% (4 / 11)
fillIn.js 50% (5 / 10) 0% (0 / 2) 0% (0 / 3) 50% (5 / 10)
filter.js 40% (4 / 10) 0% (0 / 2) 0% (0 / 2) 40% (4 / 10)
find.js 36.36% (4 / 11) 0% (0 / 2) 0% (0 / 2) 36.36% (4 / 11)
flatten.js 33.33% (5 / 15) 0% (0 / 10) 0% (0 / 3) 33.33% (5 / 15)
forIn.js 73.91% (17 / 23) 25% (4 / 16) 100% (3 / 3) 72.73% (16 / 22)
forOwn.js 100% (7 / 7) 50% (1 / 2) 100% (2 / 2) 100% (7 / 7)
functions.js 37.5% (3 / 8) 0% (0 / 2) 0% (0 / 2) 37.5% (3 / 8)
get.js 33.33% (3 / 9) 0% (0 / 2) 0% (0 / 1) 37.5% (3 / 8)
has.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
hasOwn.js 100% (3 / 3) 100% (0 / 0) 100% (1 / 1) 100% (3 / 3)
keys.js 42.86% (3 / 7) 50% (1 / 2) 0% (0 / 2) 42.86% (3 / 7)
map.js 44.44% (4 / 9) 100% (0 / 0) 0% (0 / 2) 44.44% (4 / 9)
matches.js 37.5% (3 / 8) 0% (0 / 2) 0% (0 / 2) 37.5% (3 / 8)
max.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
merge.js 31.25% (5 / 16) 0% (0 / 6) 0% (0 / 1) 31.25% (5 / 16)
min.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
mixIn.js 100% (11 / 11) 50% (1 / 2) 100% (2 / 2) 100% (11 / 11)
namespace.js 30% (3 / 10) 0% (0 / 4) 0% (0 / 2) 33.33% (3 / 9)
omit.js 44.44% (4 / 9) 0% (0 / 6) 0% (0 / 1) 44.44% (4 / 9)
pick.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 1) 42.86% (3 / 7)
pluck.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
reduce.js 30.77% (4 / 13) 0% (0 / 6) 0% (0 / 2) 30.77% (4 / 13)
reject.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 2) 57.14% (4 / 7)
result.js 42.86% (3 / 7) 0% (0 / 4) 0% (0 / 1) 42.86% (3 / 7)
set.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 1) 42.86% (3 / 7)
size.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
some.js 36.36% (4 / 11) 0% (0 / 2) 0% (0 / 2) 36.36% (4 / 11)
unset.js 33.33% (3 / 9) 0% (0 / 2) 0% (0 / 1) 33.33% (3 / 9)
values.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/bindAll.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/bindAll.js

Statements: 66.67% (6 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 66.67% (6 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1 1 1         1               1        
var functions = require('./functions');
var bind = require('../function/bind');
var forEach = require('../array/forEach');
var slice = require('../array/slice');
 
    /**
     * Binds methods of the object to be run in it's own context.
     */
    function bindAll(obj, rest_methodNames){
        var keys = arguments.length > 1?
                    slice(arguments, 1) : functions(obj);
        forEach(keys, function(key){
            obj[key] = bind(obj[key], obj);
        });
    }
 
    module.exports = bindAll;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/contains.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/contains.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151         1         1        
var some = require('./some');
 
    /**
     * Check if object contains value
     */
    function contains(obj, needle) {
        return some(obj, function(val) {
            return (val === needle);
        });
    }
    module.exports = contains;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/deepFillIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/deepFillIn.js

Statements: 26.67% (4 / 15)      Branches: 0% (0 / 8)      Functions: 0% (0 / 2)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1         1                                               1        
var forOwn = require('./forOwn');
var isPlainObject = require('../lang/isPlainObject');
 
    /**
     * Deeply copy missing properties in the target from the defaults.
     */
    function deepFillIn(target, defaults){
        var i = 0,
            n = arguments.length,
            obj;
 
        while(++i < n) {
            obj = arguments[i];
            if (obj) {
                // jshint loopfunc: true
                forOwn(obj, function(newValue, key) {
                    var curValue = target[key];
                    if (curValue == null) {
                        target[key] = newValue;
                    } else if (isPlainObject(curValue) &&
                               isPlainObject(newValue)) {
                        deepFillIn(curValue, newValue);
                    }
                });
            }
        }
 
        return target;
    }
 
    module.exports = deepFillIn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/deepMatches.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/deepMatches.js

Statements: 25.93% (7 / 27)      Branches: 0% (0 / 14)      Functions: 0% (0 / 5)      Lines: 25.93% (7 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 571 1   1                     1                     1                             1                       1        
var forOwn = require('./forOwn');
var isArray = require('../lang/isArray');
 
    function containsMatch(array, pattern) {
        var i = -1, length = array.length;
        while (++i < length) {
            if (deepMatches(array[i], pattern)) {
                return true;
            }
        }
 
        return false;
    }
 
    function matchArray(target, pattern) {
        var i = -1, patternLength = pattern.length;
        while (++i < patternLength) {
            if (!containsMatch(target, pattern[i])) {
                return false;
            }
        }
 
        return true;
    }
 
    function matchObject(target, pattern) {
        var result = true;
        forOwn(pattern, function(val, key) {
            if (!deepMatches(target[key], val)) {
                // Return false to break out of forOwn early
                return (result = false);
            }
        });
 
        return result;
    }
 
    /**
     * Recursively check if the objects match.
     */
    function deepMatches(target, pattern){
        if (target && typeof target === 'object') {
            if (isArray(target) && isArray(pattern)) {
                return matchArray(target, pattern);
            } else {
                return matchObject(target, pattern);
            }
        } else {
            return target === pattern;
        }
    }
 
    module.exports = deepMatches;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/deepMixIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/deepMixIn.js

Statements: 33.33% (5 / 15)      Branches: 0% (0 / 6)      Functions: 0% (0 / 2)      Lines: 33.33% (5 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361 1           1                             1                 1        
var forOwn = require('./forOwn');
var isPlainObject = require('../lang/isPlainObject');
 
    /**
     * Mixes objects into the target object, recursively mixing existing child
     * objects.
     */
    function deepMixIn(target, objects) {
        var i = 0,
            n = arguments.length,
            obj;
 
        while(++i < n){
            obj = arguments[i];
            if (obj) {
                forOwn(obj, copyProp, target);
            }
        }
 
        return target;
    }
 
    function copyProp(val, key) {
        var existing = this[key];
        if (isPlainObject(val) && isPlainObject(existing)) {
            deepMixIn(existing, val);
        } else {
            this[key] = val;
        }
    }
 
    module.exports = deepMixIn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/equals.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/equals.js

Statements: 53.33% (8 / 15)      Branches: 0% (0 / 10)      Functions: 0% (0 / 4)      Lines: 53.33% (8 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1 1 1       1           1             1                     1      
var hasOwn = require('./hasOwn');
var every = require('./every');
var isObject = require('../lang/isObject');
var is = require('../lang/is');
 
    // Makes a function to compare the object values from the specified compare
    // operation callback.
    function makeCompare(callback) {
        return function(value, key) {
            return hasOwn(this, key) && callback(value, this[key]);
        };
    }
 
    function checkProperties(value, key) {
        return hasOwn(this, key);
    }
 
    /**
     * Checks if two objects have the same keys and values.
     */
    function equals(a, b, callback) {
        callback = callback || is;
 
        if (!isObject(a) || !isObject(b)) {
            return callback(a, b);
        }
 
        return (every(a, makeCompare(callback), b) &&
                every(b, checkProperties, a));
    }
 
    module.exports = equals;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/every.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/every.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1         1                           1        
var forOwn = require('./forOwn');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Object every
     */
    function every(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var result = true;
        forOwn(obj, function(val, key) {
            // we consider any falsy values as "false" on purpose so shorthand
            // syntax can be used to check property existence
            if (!callback(val, key, obj)) {
                result = false;
                return false; // break
            }
        });
        return result;
    }
 
    module.exports = every;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/fillIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/fillIn.js

Statements: 50% (5 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 50% (5 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1 1         1                     1        
var forEach = require('../array/forEach');
var slice = require('../array/slice');
var forOwn = require('./forOwn');
 
    /**
     * Copy missing properties in the obj from the defaults.
     */
    function fillIn(obj, var_defaults){
        forEach(slice(arguments, 1), function(base){
            forOwn(base, function(val, key){
                if (obj[key] == null) {
                    obj[key] = val;
                }
            });
        });
        return obj;
    }
 
    module.exports = fillIn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/filter.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/filter.js

Statements: 40% (4 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 40% (4 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1           1                     1      
var forOwn = require('./forOwn');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Creates a new object with all the properties where the callback returns
     * true.
     */
    function filterValues(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var output = {};
        forOwn(obj, function(value, key, obj) {
            if (callback(value, key, obj)) {
                output[key] = value;
            }
        });
 
        return output;
    }
    module.exports = filterValues;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/find.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/find.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1         1                       1        
var some = require('./some');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Returns first item that matches criteria
     */
    function find(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var result;
        some(obj, function(value, key, obj) {
            if (callback(value, key, obj)) {
                result = value;
                return true; //break
            }
        });
        return result;
    }
 
    module.exports = find;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/flatten.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/flatten.js

Statements: 33.33% (5 / 15)      Branches: 0% (0 / 10)      Functions: 0% (0 / 3)      Lines: 33.33% (5 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 401 1           1                                     1                 1        
var forOwn = require('./forOwn');
var isPlainObject = require('../lang/isPlainObject');
 
    /*
     * Helper function to flatten to a destination object.
     * Used to remove the need to create intermediate objects while flattening.
     */
    function flattenTo(obj, result, prefix, level) {
        forOwn(obj, function (value, key) {
            var nestedPrefix = prefix ? prefix + '.' + key : key;
 
            if (level !== 0 && isPlainObject(value)) {
                flattenTo(value, result, nestedPrefix, level - 1);
            } else {
                result[nestedPrefix] = value;
            }
        });
 
        return result;
    }
 
    /**
     * Recursively flattens an object.
     * A new object containing all the elements is returned.
     * If level is specified, it will only flatten up to that level.
     */
    function flatten(obj, level) {
        if (obj == null) {
            return {};
        }
 
        level = level == null ? -1 : level;
        return flattenTo(obj, {}, '', level);
    }
 
    module.exports = flatten;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/forIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/forIn.js

Statements: 73.91% (17 / 23)      Branches: 25% (4 / 16)      Functions: 100% (3 / 3)      Lines: 72.73% (16 / 22)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 781   1     1 1                   1   1 1                 1 5         5   5 29           5                                                   1 29     1        
var hasOwn = require('./hasOwn');
 
    var _hasDontEnumBug,
        _dontEnums;
 
    function checkDontEnum(){
        _dontEnums = [
                'toString',
                'toLocaleString',
                'valueOf',
                'hasOwnProperty',
                'isPrototypeOf',
                'propertyIsEnumerable',
                'constructor'
            ];
 
        _hasDontEnumBug = true;
 
        for (var key in {'toString': null}) {
            _hasDontEnumBug = false;
        }
    }
 
    /**
     * Similar to Array/forEach but works over object properties and fixes Don't
     * Enum bug on IE.
     * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
     */
    function forIn(obj, fn, thisObj){
        var key, i = 0;
        // no need to check if argument is a real object that way we can use
        // it for arrays, functions, date, etc.
 
        //post-pone check till needed
        if (_hasDontEnumBug == null) checkDontEnum();
 
        for (key in obj) {
            Iif (exec(fn, obj, key, thisObj) === false) {
                break;
            }
        }
 
 
        Iif (_hasDontEnumBug) {
            var ctor = obj.constructor,
                isProto = !!ctor && obj === ctor.prototype;
 
            while (key = _dontEnums[i++]) {
                // For constructor, if it is a prototype object the constructor
                // is always non-enumerable unless defined otherwise (and
                // enumerated above).  For non-prototype objects, it will have
                // to be defined on this object, since it cannot be defined on
                // any prototype objects.
                //
                // For other [[DontEnum]] properties, check if the value is
                // different than Object prototype value.
                if (
                    (key !== 'constructor' ||
                        (!isProto && hasOwn(obj, key))) &&
                    obj[key] !== Object.prototype[key]
                ) {
                    if (exec(fn, obj, key, thisObj) === false) {
                        break;
                    }
                }
            }
        }
    }
 
    function exec(fn, obj, key, thisObj){
        return fn.call(thisObj, obj[key], key, obj);
    }
 
    module.exports = forIn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/forOwn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/forOwn.js

Statements: 100% (7 / 7)      Branches: 50% (1 / 2)      Functions: 100% (2 / 2)      Lines: 100% (7 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1             1 5 29 29         1        
var hasOwn = require('./hasOwn');
var forIn = require('./forIn');
 
    /**
     * Similar to Array/forEach but works over object properties and fixes Don't
     * Enum bug on IE.
     * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
     */
    function forOwn(obj, fn, thisObj){
        forIn(obj, function(val, key){
            Eif (hasOwn(obj, key)) {
                return fn.call(thisObj, obj[key], key, obj);
            }
        });
    }
 
    module.exports = forOwn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/functions.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/functions.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var forIn = require('./forIn');
 
    /**
     * return a list of all enumerable properties that have function values
     */
    function functions(obj){
        var keys = [];
        forIn(obj, function(val, key){
            if (typeof val === 'function'){
                keys.push(key);
            }
        });
        return keys.sort();
    }
 
    module.exports = functions;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/get.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/get.js

Statements: 33.33% (3 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221         1                       1        
var isPrimitive = require('../lang/isPrimitive');
 
    /**
     * get "nested" object property
     */
    function get(obj, prop){
        var parts = prop.split('.'),
            last = parts.pop();
 
        while (prop = parts.shift()) {
            obj = obj[prop];
            if (obj == null) return;
        }
 
        return obj[last];
    }
 
    module.exports = get;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/has.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/has.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171   1         1       1          
var get = require('./get');
 
    var UNDEF;
 
    /**
     * Check if object has nested property.
     */
    function has(obj, prop){
        return get(obj, prop) !== UNDEF;
    }
 
    module.exports = has;
 
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/hasOwn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/hasOwn.js

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (3 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14          1 29     1        
 
 
    /**
     * Safer Object.hasOwnProperty
     */
     function hasOwn(obj, prop){
         return Object.prototype.hasOwnProperty.call(obj, prop);
     }
 
     module.exports = hasOwn;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/keys.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/keys.js

Statements: 42.86% (3 / 7)      Branches: 50% (1 / 2)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var forOwn = require('./forOwn');
 
    /**
     * Get object keys
     */
     var keys = Object.keys || function (obj) {
            var keys = [];
            forOwn(obj, function(val, key){
                keys.push(key);
            });
            return keys;
        };
 
    module.exports = keys;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/map.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/map.js

Statements: 44.44% (4 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201 1           1                 1      
var forOwn = require('./forOwn');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Creates a new object where all the values are the result of calling
     * `callback`.
     */
    function mapValues(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var output = {};
        forOwn(obj, function(val, key, obj) {
            output[key] = callback(val, key, obj);
        });
 
        return output;
    }
    module.exports = mapValues;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/matches.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/matches.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221         1                       1        
var forOwn = require('./forOwn');
 
    /**
     * checks if a object contains all given properties/values
     */
    function matches(target, props){
        // can't use "object/every" because of circular dependency
        var result = true;
        forOwn(props, function(val, key){
            if (target[key] !== val) {
                // break loop at first difference
                return (result = false);
            }
        });
        return result;
    }
 
    module.exports = matches;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/max.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/max.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1         1       1      
var arrMax = require('../array/max');
var values = require('./values');
 
    /**
     * Returns maximum value inside object.
     */
    function max(obj, compareFn) {
        return arrMax(values(obj), compareFn);
    }
 
    module.exports = max;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/merge.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/merge.js

Statements: 31.25% (5 / 16)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 31.25% (5 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421 1 1         1                                                           1        
var hasOwn = require('./hasOwn');
var deepClone = require('../lang/deepClone');
var isObject = require('../lang/isObject');
 
    /**
     * Deep merge objects.
     */
    function merge() {
        var i = 1,
            key, val, obj, target;
 
        // make sure we don't modify source element and it's properties
        // objects are passed by reference
        target = deepClone( arguments[0] );
 
        while (obj = arguments[i++]) {
            for (key in obj) {
                if ( ! hasOwn(obj, key) ) {
                    continue;
                }
 
                val = obj[key];
 
                if ( isObject(val) && isObject(target[key]) ){
                    // inception, deep merge objects
                    target[key] = merge(target[key], val);
                } else {
                    // make sure arrays, regexp, date, objects are cloned
                    target[key] = deepClone(val);
                }
 
            }
        }
 
        return target;
    }
 
    module.exports = merge;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/min.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/min.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1         1       1      
var arrMin = require('../array/min');
var values = require('./values');
 
    /**
     * Returns minimum value inside object.
     */
    function min(obj, iterator) {
        return arrMin(values(obj), iterator);
    }
 
    module.exports = min;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/mixIn.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/mixIn.js

Statements: 100% (11 / 11)      Branches: 50% (1 / 2)      Functions: 100% (2 / 2)      Lines: 100% (11 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301                 1 2     2 3 3 3     2     1 10     1      
var forOwn = require('./forOwn');
 
    /**
    * Combine properties from all the objects into first one.
    * - This method affects target object in place, if you want to create a new Object pass an empty object as first param.
    * @param {object} target    Target Object
    * @param {...object} objects    Objects to be combined (0...n objects).
    * @return {object} Target Object.
    */
    function mixIn(target, objects){
        var i = 0,
            n = arguments.length,
            obj;
        while(++i < n){
            obj = arguments[i];
            Eif (obj != null) {
                forOwn(obj, copyProp, target);
            }
        }
        return target;
    }
 
    function copyProp(val, key){
        this[key] = val;
    }
 
    module.exports = mixIn;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/namespace.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/namespace.js

Statements: 30% (3 / 10)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 33.33% (3 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211         1                     1        
var forEach = require('../array/forEach');
 
    /**
     * Create nested object if non-existent
     */
    function namespace(obj, path){
        if (!path) return obj;
        forEach(path.split('.'), function(key){
            if (!obj[key]) {
                obj[key] = {};
            }
            obj = obj[key];
        });
        return obj;
    }
 
    module.exports = namespace;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/omit.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/omit.js

Statements: 44.44% (4 / 9)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1         1                       1        
var slice = require('../array/slice');
var contains = require('../array/contains');
 
    /**
     * Return a copy of the object, filtered to only contain properties except the blacklisted keys.
     */
    function omit(obj, var_keys){
        var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1),
            out = {};
 
        for (var property in obj) {
            if (obj.hasOwnProperty(property) && !contains(keys, property)) {
                out[property] = obj[property];
            }
        }
        return out;
    }
 
    module.exports = omit;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/pick.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/pick.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var slice = require('../array/slice');
 
    /**
     * Return a copy of the object, filtered to only have values for the whitelisted keys.
     */
    function pick(obj, var_keys){
        var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1),
            out = {},
            i = 0, key;
        while (key = keys[i++]) {
            out[key] = obj[key];
        }
        return out;
    }
 
    module.exports = pick;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/pluck.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/pluck.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1         1       1        
var map = require('./map');
var prop = require('../function/prop');
 
    /**
     * Extract a list of property values.
     */
    function pluck(obj, propName){
        return map(obj, prop(propName));
    }
 
    module.exports = pluck;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/reduce.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/reduce.js

Statements: 30.77% (4 / 13)      Branches: 0% (0 / 6)      Functions: 0% (0 / 2)      Lines: 30.77% (4 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311 1         1                                       1        
var forOwn = require('./forOwn');
var size = require('./size');
 
    /**
     * Object reduce
     */
    function reduce(obj, callback, memo, thisObj) {
        var initial = arguments.length > 2;
 
        if (!size(obj) && !initial) {
            throw new Error('reduce of empty object with no initial value');
        }
 
        forOwn(obj, function(value, key, list) {
            if (!initial) {
                memo = value;
                initial = true;
            }
            else {
                memo = callback.call(thisObj, memo, value, key, list);
            }
        });
 
        return memo;
    }
 
    module.exports = reduce;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/reject.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/reject.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1         1             1        
var filter = require('./filter');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Object reject
     */
    function reject(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        return filter(obj, function(value, index, obj) {
            return !callback(value, index, obj);
        }, thisObj);
    }
 
    module.exports = reject;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/result.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/result.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161   1                   1      
var isFunction = require('../lang/isFunction');
 
    function result(obj, prop) {
        var property = obj[prop];
 
        if(property === undefined) {
            return;
        }
 
        return isFunction(property) ? property.call(obj) : property;
    }
 
    module.exports = result;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/set.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/set.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191         1                 1        
var namespace = require('./namespace');
 
    /**
     * set "nested" object property
     */
    function set(obj, prop, val){
        var parts = (/^(.+)\.(.+)$/).exec(prop);
        if (parts){
            namespace(obj, parts[1])[parts[2]] = val;
        } else {
            obj[prop] = val;
        }
    }
 
    module.exports = set;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/size.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/size.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var forOwn = require('./forOwn');
 
    /**
     * Get object size
     */
    function size(obj) {
        var count = 0;
        forOwn(obj, function(){
            count++;
        });
        return count;
    }
 
    module.exports = size;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/some.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/some.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1         1                       1        
var forOwn = require('./forOwn');
var makeIterator = require('../function/makeIterator_');
 
    /**
     * Object some
     */
    function some(obj, callback, thisObj) {
        callback = makeIterator(callback, thisObj);
        var result = false;
        forOwn(obj, function(val, key) {
            if (callback(val, key, obj)) {
                result = true;
                return false; // break
            }
        });
        return result;
    }
 
    module.exports = some;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/unset.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/unset.js

Statements: 33.33% (3 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 33.33% (3 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251         1                             1        
var has = require('./has');
 
    /**
     * Unset object property.
     */
    function unset(obj, prop){
        if (has(obj, prop)) {
            var parts = prop.split('.'),
                last = parts.pop();
            while (prop = parts.shift()) {
                obj = obj[prop];
            }
            return (delete obj[last]);
 
        } else {
            // if property doesn't exist treat as deleted
            return true;
        }
    }
 
    module.exports = unset;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/values.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/object/values.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var forOwn = require('./forOwn');
 
    /**
     * Get object values
     */
    function values(obj) {
        var vals = [];
        forOwn(obj, function(val, key){
            vals.push(val);
        });
        return vals;
    }
 
    module.exports = values;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/

Statements: 37.88% (25 / 66)      Branches: 0% (0 / 28)      Functions: 0% (0 / 9)      Lines: 37.88% (25 / 66)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/
File Statements Branches Functions Lines
contains.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
decode.js 27.78% (5 / 18) 0% (0 / 8) 0% (0 / 1) 27.78% (5 / 18)
encode.js 33.33% (5 / 15) 0% (0 / 4) 0% (0 / 3) 33.33% (5 / 15)
getParam.js 66.67% (4 / 6) 0% (0 / 6) 0% (0 / 1) 66.67% (4 / 6)
getQuery.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
parse.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
setParam.js 16.67% (2 / 12) 0% (0 / 8) 0% (0 / 1) 16.67% (2 / 12)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/contains.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/contains.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1         1      
var getQuery = require('./getQuery');
 
    /**
     * Checks if query string contains parameter.
     */
    function contains(url, paramName) {
        var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `&param=`
        return regex.test(getQuery(url));
    }
 
    module.exports = contains;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/decode.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/decode.js

Statements: 27.78% (5 / 18)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 27.78% (5 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 381 1 1         1                                                     1      
var typecast = require('../string/typecast');
var isArray = require('../lang/isArray');
var hasOwn = require('../object/hasOwn');
 
    /**
     * Decode query string into an object of keys => vals.
     */
    function decode(queryStr, shouldTypecast) {
        var queryArr = (queryStr || '').replace('?', '').split('&'),
            reg = /([^=]+)=(.+)/,
            i = -1,
            obj = {},
            equalIndex, cur, pValue, pName;
 
        while ((cur = queryArr[++i])) {
            equalIndex = cur.indexOf('=');
            pName = cur.substring(0, equalIndex);
            pValue = decodeURIComponent(cur.substring(equalIndex + 1));
            if (shouldTypecast !== false) {
                pValue = typecast(pValue);
            }
            if (hasOwn(obj, pName)){
                if(isArray(obj[pName])){
                    obj[pName].push(pValue);
                } else {
                    obj[pName] = [obj[pName], pValue];
                }
            } else {
                obj[pName] = pValue;
           }
        }
        return obj;
    }
 
    module.exports = decode;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/encode.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/encode.js

Statements: 33.33% (5 / 15)      Branches: 0% (0 / 4)      Functions: 0% (0 / 3)      Lines: 33.33% (5 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291 1 1         1                                   1      
var forOwn = require('../object/forOwn');
var isArray = require('../lang/isArray');
var forEach = require('../array/forEach');
 
    /**
     * Encode object into a query string.
     */
    function encode(obj){
        var query = [],
            arrValues, reg;
        forOwn(obj, function (val, key) {
            if (isArray(val)) {
                arrValues = key + '=';
                reg = new RegExp('&'+key+'+=$');
                forEach(val, function (aValue) {
                    arrValues += encodeURIComponent(aValue) + '&' + key + '=';
                });
                query.push(arrValues.replace(reg, ''));
            } else {
               query.push(key + '=' + encodeURIComponent(val));
            }
        });
        return (query.length) ? '?' + query.join('&') : '';
    }
 
    module.exports = encode;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/getParam.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/getParam.js

Statements: 66.67% (4 / 6)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1         1             1      
var typecast = require('../string/typecast');
var getQuery = require('./getQuery');
 
    /**
     * Get query parameter value.
     */
    function getParam(url, param, shouldTypecast){
        var regexp = new RegExp('(\\?|&)'+ param + '=([^&]*)'), //matches `?param=value` or `&param=value`, value = $2
            result = regexp.exec( getQuery(url) ),
            val = (result && result[2])? result[2] : null;
        return shouldTypecast === false? val : typecast(val);
    }
 
    module.exports = getParam;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/getQuery.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/getQuery.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15          1           1      
 
 
    /**
     * Gets full query as string with all special chars decoded.
     */
    function getQuery(url) {
        url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query)
        var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt
        return (queryString)? decodeURIComponent(queryString[0].replace(/\+/g,' ')) : '';
    }
 
    module.exports = getQuery;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/parse.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/parse.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1         1       1        
var decode = require('./decode');
var getQuery = require('./getQuery');
 
    /**
     * Get query string, parses and decodes it.
     */
    function parse(url, shouldTypecast) {
        return decode(getQuery(url), shouldTypecast);
    }
 
    module.exports = parse;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/setParam.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/queryString/setParam.js

Statements: 16.67% (2 / 12)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30          1                                       1        
 
 
    /**
     * Set query string parameter value
     */
    function setParam(url, paramName, value){
        url = url || '';
 
        var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' );
        var param = paramName +'='+ encodeURIComponent( value );
 
        if ( re.test(url) ) {
            return url.replace(re, '$1'+ param);
        } else {
            if (url.indexOf('?') === -1) {
                url += '?';
            }
            if (url.indexOf('=') !== -1) {
                url += '&';
            }
            return url + param;
        }
 
    }
 
    module.exports = setParam;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/

Statements: 60.61% (40 / 66)      Branches: 0% (0 / 28)      Functions: 0% (0 / 10)      Lines: 60.61% (40 / 66)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/
File Statements Branches Functions Lines
choice.js 66.67% (4 / 6) 0% (0 / 4) 0% (0 / 1) 66.67% (4 / 6)
guid.js 80% (4 / 5) 100% (0 / 0) 0% (0 / 1) 80% (4 / 5)
rand.js 62.5% (5 / 8) 0% (0 / 4) 0% (0 / 1) 62.5% (5 / 8)
randBit.js 75% (3 / 4) 0% (0 / 2) 0% (0 / 1) 75% (3 / 4)
randBool.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
randHex.js 44.44% (4 / 9) 0% (0 / 4) 0% (0 / 1) 44.44% (4 / 9)
randInt.js 62.5% (5 / 8) 0% (0 / 4) 0% (0 / 1) 62.5% (5 / 8)
randSign.js 75% (3 / 4) 0% (0 / 2) 0% (0 / 1) 75% (3 / 4)
randString.js 42.86% (6 / 14) 0% (0 / 8) 0% (0 / 1) 42.86% (6 / 14)
random.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/choice.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/choice.js

Statements: 66.67% (4 / 6)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1           1         1        
var randInt = require('./randInt');
var isArray = require('../lang/isArray');
 
    /**
     * Returns a random element from the supplied arguments
     * or from the array (if single argument is an array).
     */
    function choice(items) {
        var target = (arguments.length === 1 && isArray(items))? items : arguments;
        return target[ randInt(0, target.length - 1) ];
    }
 
    module.exports = choice;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/guid.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/guid.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1                 1                       1      
var randHex = require('./randHex');
var choice = require('./choice');
 
  /**
   * Returns pseudo-random guid (UUID v4)
   * IMPORTANT: it's not totally "safe" since randHex/choice uses Math.random
   * by default and sequences can be predicted in some cases. See the
   * "random/random" documentation for more info about it and how to replace
   * the default PRNG.
   */
  function guid() {
    return (
        randHex(8)+'-'+
        randHex(4)+'-'+
        // v4 UUID always contain "4" at this position to specify it was
        // randomly generated
        '4' + randHex(3) +'-'+
        // v4 UUID always contain chars [a,b,8,9] at this position
        choice(8, 9, 'a', 'b') + randHex(3)+'-'+
        randHex(12)
    );
  }
  module.exports = guid;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/rand.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/rand.js

Statements: 62.5% (5 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1         1           1      
var random = require('./random');
var MIN_INT = require('../number/MIN_INT');
var MAX_INT = require('../number/MAX_INT');
 
    /**
     * Returns random number inside range
     */
    function rand(min, max){
        min = min == null? MIN_INT : min;
        max = max == null? MAX_INT : max;
        return min + (max - min) * random();
    }
 
    module.exports = rand;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randBit.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randBit.js

Statements: 75% (3 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131         1       1      
var randBool = require('./randBool');
 
    /**
     * Returns random bit (0 or 1)
     */
    function randomBit() {
        return randBool()? 1 : 0;
    }
 
    module.exports = randomBit;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randBool.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randBool.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1       1        
var random = require('./random');
 
    /**
     * returns a random boolean value (true or false)
     */
    function randBool(){
        return random() >= 0.5;
    }
 
    module.exports = randBool;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randHex.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randHex.js

Statements: 44.44% (4 / 9)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211   1         1                 1        
var choice = require('./choice');
 
    var _chars = '0123456789abcdef'.split('');
 
    /**
     * Returns a random hexadecimal string
     */
    function randHex(size){
        size = size && size > 0? size : 6;
        var str = '';
        while (size--) {
            str += choice(_chars);
        }
        return str;
    }
 
    module.exports = randHex;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randInt.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randInt.js

Statements: 62.5% (5 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201 1 1         1                 1      
var MIN_INT = require('../number/MIN_INT');
var MAX_INT = require('../number/MAX_INT');
var rand = require('./rand');
 
    /**
     * Gets random integer inside range or snap to min/max values.
     */
    function randInt(min, max){
        min = min == null? MIN_INT : ~~min;
        max = max == null? MAX_INT : ~~max;
        // can't be max + 0.5 otherwise it will round up if `rand`
        // returns `max` causing it to overflow range.
        // -0.5 and + 0.49 are required to avoid bias caused by rounding
        return Math.round( rand(min - 0.5, max + 0.499999999999) );
    }
 
    module.exports = randInt;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randSign.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randSign.js

Statements: 75% (3 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131         1       1      
var randBool = require('./randBool');
 
    /**
     * Returns random sign (-1 or 1)
     */
    function randomSign() {
        return randBool()? 1 : -1;
    }
 
    module.exports = randomSign;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randString.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/randString.js

Statements: 42.86% (6 / 14)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 42.86% (6 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291 1 1   1   1                                     1      
var isNumber = require('../lang/isNumber');
var isString = require('../lang/isString');
var randInt = require('./randInt');
 
    var defaultDictionary = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
    function randomString(length, dictionary) {
        if(!isNumber(length) || length <= 0) {
          length = 8;
        }
 
        if(!isString(dictionary) || dictionary.length < 1) {
          dictionary = defaultDictionary;
        }
 
        var result = '',
            domain = dictionary.length - 1;
 
        while(length--) {
          result += dictionary[randInt(0, domain)];
        }
        
        return result;
    }
 
    module.exports = randomString;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/random.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/random/random.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                1         1   1        
 
 
    /**
     * Just a wrapper to Math.random. No methods inside mout/random should call
     * Math.random() directly so we can inject the pseudo-random number
     * generator if needed (ie. in case we need a seeded random or a better
     * algorithm than the native one)
     */
    function random(){
        return random.get();
    }
 
    // we expose the method so it can be swapped if needed
    random.get = Math.random;
 
    module.exports = random;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/

Statements: 47.42% (147 / 310)      Branches: 0% (0 / 76)      Functions: 0% (0 / 41)      Lines: 47.42% (147 / 310)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/
File Statements Branches Functions Lines
WHITE_SPACES.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
camelCase.js 63.64% (7 / 11) 100% (0 / 0) 0% (0 / 1) 63.64% (7 / 11)
contains.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 1) 50% (3 / 6)
crop.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
endsWith.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 1) 50% (3 / 6)
escapeHtml.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
escapeRegExp.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
escapeUnicode.js 37.5% (3 / 8) 0% (0 / 4) 0% (0 / 2) 37.5% (3 / 8)
hyphenate.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
insert.js 44.44% (4 / 9) 0% (0 / 2) 0% (0 / 1) 44.44% (4 / 9)
interpolate.js 55.56% (5 / 9) 0% (0 / 2) 0% (0 / 2) 55.56% (5 / 9)
lowerCase.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
lpad.js 57.14% (4 / 7) 0% (0 / 4) 0% (0 / 1) 57.14% (4 / 7)
ltrim.js 23.53% (4 / 17) 0% (0 / 8) 0% (0 / 1) 23.53% (4 / 17)
makePath.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
normalizeLineBreaks.js 50% (3 / 6) 0% (0 / 2) 0% (0 / 1) 50% (3 / 6)
pascalCase.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 1) 71.43% (5 / 7)
properCase.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 1) 71.43% (5 / 7)
removeNonASCII.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
removeNonWord.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
repeat.js 26.67% (4 / 15) 0% (0 / 4) 0% (0 / 1) 26.67% (4 / 15)
replace.js 28.57% (4 / 14) 0% (0 / 6) 0% (0 / 1) 28.57% (4 / 14)
replaceAccents.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 1) 42.86% (3 / 7)
rpad.js 57.14% (4 / 7) 0% (0 / 4) 0% (0 / 1) 57.14% (4 / 7)
rtrim.js 23.53% (4 / 17) 0% (0 / 8) 0% (0 / 1) 23.53% (4 / 17)
sentenceCase.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 1) 71.43% (5 / 7)
slugify.js 46.15% (6 / 13) 0% (0 / 2) 0% (0 / 1) 46.15% (6 / 13)
startsWith.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 1) 50% (3 / 6)
stripHtmlTags.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
trim.js 66.67% (6 / 9) 0% (0 / 2) 0% (0 / 1) 66.67% (6 / 9)
truncate.js 30.77% (4 / 13) 0% (0 / 8) 0% (0 / 1) 30.77% (4 / 13)
typecast.js 18.75% (3 / 16) 0% (0 / 16) 0% (0 / 1) 18.75% (3 / 16)
unCamelCase.js 41.67% (5 / 12) 0% (0 / 2) 0% (0 / 2) 41.67% (5 / 12)
underscore.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
unescapeHtml.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
unescapeUnicode.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
unhyphenate.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
upperCase.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/WHITE_SPACES.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/WHITE_SPACES.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14          1                
 
    /**
     * Contains all Unicode white-spaces. Taken from
     * http://en.wikipedia.org/wiki/Whitespace_character.
     */
    module.exports = [
        ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E',
        '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006',
        '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F',
        '\u205F', '\u3000'
    ];
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/camelCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/camelCase.js

Statements: 63.64% (7 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 63.64% (7 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1 1 1 1       1                   1      
var toString = require('../lang/toString');
var replaceAccents = require('./replaceAccents');
var removeNonWord = require('./removeNonWord');
var upperCase = require('./upperCase');
var lowerCase = require('./lowerCase');
    /**
    * Convert string to camelCase text.
    */
    function camelCase(str){
        str = toString(str);
        str = replaceAccents(str);
        str = removeNonWord(str)
            .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces
            .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE
            .replace(/\s+/g, '') //remove spaces
            .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase
        return str;
    }
    module.exports = camelCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/contains.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/contains.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161         1           1        
var toString = require('../lang/toString');
 
    /**
     * Searches for a given substring
     */
    function contains(str, substring, fromIndex){
        str = toString(str);
        substring = toString(substring);
        return str.indexOf(substring, fromIndex) !== -1;
    }
 
    module.exports = contains;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/crop.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/crop.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1       1         1      
var toString = require('../lang/toString');
var truncate = require('./truncate');
    /**
     * Truncate string at full words.
     */
     function crop(str, maxChars, append) {
         str = toString(str);
         return truncate(str, maxChars, append, true);
     }
 
     module.exports = crop;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/endsWith.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/endsWith.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151       1             1      
var toString = require('../lang/toString');
    /**
     * Checks if string ends with specified suffix.
     */
    function endsWith(str, suffix) {
        str = toString(str);
        suffix = toString(suffix);
 
        return str.indexOf(suffix, str.length - suffix.length) !== -1;
    }
 
    module.exports = endsWith;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/escapeHtml.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/escapeHtml.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var toString = require('../lang/toString');
 
    /**
     * Escapes a string for insertion into HTML.
     */
    function escapeHtml(str){
        str = toString(str)
            .replace(/&/g, '&amp;')
            .replace(/</g, '&lt;')
            .replace(/>/g, '&gt;')
            .replace(/'/g, '&#39;')
            .replace(/"/g, '&quot;');
        return str;
    }
 
    module.exports = escapeHtml;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/escapeRegExp.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/escapeRegExp.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141         1       1        
var toString = require('../lang/toString');
 
    /**
     * Escape RegExp string chars.
     */
    function escapeRegExp(str) {
        return toString(str).replace(/\W/g,'\\$&');
    }
 
    module.exports = escapeRegExp;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/escapeUnicode.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/escapeUnicode.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231         1                         1        
var toString = require('../lang/toString');
 
    /**
     * Escape string into unicode sequences
     */
    function escapeUnicode(str, shouldEscapePrintable){
        str = toString(str);
        return str.replace(/[\s\S]/g, function(ch){
            // skip printable ASCII chars if we should not escape them
            if (!shouldEscapePrintable && (/[\x20-\x7E]/).test(ch)) {
                return ch;
            }
            // we use "000" and slice(-4) for brevity, need to pad zeros,
            // unicode escape always have 4 chars after "\u"
            return '\\u'+ ('000'+ ch.charCodeAt(0).toString(16)).slice(-4);
        });
    }
 
    module.exports = escapeUnicode;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/hyphenate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/hyphenate.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1 1       1           1      
var toString = require('../lang/toString');
var slugify = require('./slugify');
var unCamelCase = require('./unCamelCase');
    /**
     * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case.
     */
    function hyphenate(str){
        str = toString(str);
        str = unCamelCase(str);
        return slugify(str, "-");
    }
 
    module.exports = hyphenate;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/insert.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/insert.js

Statements: 44.44% (4 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1         1                       1        
var clamp = require('../math/clamp');
var toString = require('../lang/toString');
 
    /**
     * Inserts a string at a given index.
     */
    function insert(string, index, partial){
        string = toString(string);
 
        if (index < 0) {
            index = string.length + index;
        }
 
        index = clamp(index, 0, string.length);
 
        return string.substr(0, index) + partial + string.substr(index);
    }
 
    module.exports = insert;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/interpolate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/interpolate.js

Statements: 55.56% (5 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 55.56% (5 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1   1         1               1        
var toString = require('../lang/toString');
var get = require('../object/get');
 
    var stache = /\{\{([^\}]+)\}\}/g; //mustache-like
 
    /**
     * String interpolation
     */
    function interpolate(template, replacements, syntax){
        template = toString(template);
        var replaceFn = function(match, prop){
            return toString( get(replacements, prop) );
        };
        return template.replace(syntax || stache, replaceFn);
    }
 
    module.exports = interpolate;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/lowerCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/lowerCase.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131       1         1      
var toString = require('../lang/toString');
    /**
     * "Safer" String.toLowerCase()
     */
    function lowerCase(str){
        str = toString(str);
        return str.toLowerCase();
    }
 
    module.exports = lowerCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/lpad.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/lpad.js

Statements: 57.14% (4 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191 1         1               1        
var toString = require('../lang/toString');
var repeat = require('./repeat');
 
    /**
     * Pad string with `char` if its' length is smaller than `minLen`
     */
    function lpad(str, minLen, ch) {
        str = toString(str);
        ch = ch || ' ';
 
        return (str.length < minLen) ?
            repeat(ch, minLen - str.length) + str : str;
    }
 
    module.exports = lpad;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/ltrim.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/ltrim.js

Statements: 23.53% (4 / 17)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 23.53% (4 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361 1       1                                                     1      
var toString = require('../lang/toString');
var WHITE_SPACES = require('./WHITE_SPACES');
    /**
     * Remove chars from beginning of string.
     */
    function ltrim(str, chars) {
        str = toString(str);
        chars = chars || WHITE_SPACES;
 
        var start = 0,
            len = str.length,
            charLen = chars.length,
            found = true,
            i, c;
 
        while (found && start < len) {
            found = false;
            i = -1;
            c = str.charAt(start);
 
            while (++i < charLen) {
                if (c === chars[i]) {
                    found = true;
                    start++;
                    break;
                }
            }
        }
 
        return (start >= len) ? '' : str.substr(start, len);
    }
 
    module.exports = ltrim;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/makePath.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/makePath.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1           1           1      
var join = require('../array/join');
var slice = require('../array/slice');
 
    /**
     * Group arguments as path segments, if any of the args is `null` or an
     * empty string it will be ignored from resulting path.
     */
    function makePath(var_args){
        var result = join(slice(arguments), '/');
        // need to disconsider duplicate '/' after protocol (eg: 'http://')
        return result.replace(/([^:\/]|^)\/{2,}/g, '$1/');
    }
 
    module.exports = makePath;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/normalizeLineBreaks.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/normalizeLineBreaks.js

Statements: 50% (3 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var toString = require('../lang/toString');
 
    /**
     * Convert line-breaks from DOS/MAC to a single standard (UNIX by default)
     */
    function normalizeLineBreaks(str, lineEnd) {
        str = toString(str);
        lineEnd = lineEnd || '\n';
 
        return str
            .replace(/\r\n/g, lineEnd) // DOS
            .replace(/\r/g, lineEnd)   // Mac
            .replace(/\n/g, lineEnd);  // Unix
    }
 
    module.exports = normalizeLineBreaks;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/pascalCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/pascalCase.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1       1         1      
var toString = require('../lang/toString');
var camelCase = require('./camelCase');
var upperCase = require('./upperCase');
    /**
     * camelCase + UPPERCASE first char
     */
    function pascalCase(str){
        str = toString(str);
        return camelCase(str).replace(/^[a-z]/, upperCase);
    }
 
    module.exports = pascalCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/properCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/properCase.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1       1         1      
var toString = require('../lang/toString');
var lowerCase = require('./lowerCase');
var upperCase = require('./upperCase');
    /**
     * UPPERCASE first char of each word.
     */
    function properCase(str){
        str = toString(str);
        return lowerCase(str).replace(/^\w|\s\w/g, upperCase);
    }
 
    module.exports = properCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/removeNonASCII.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/removeNonASCII.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161       1               1      
var toString = require('../lang/toString');
    /**
     * Remove non-printable ASCII chars
     */
    function removeNonASCII(str){
        str = toString(str);
 
        // Matches non-printable ASCII chars -
        // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
        return str.replace(/[^\x20-\x7E]/g, '');
    }
 
    module.exports = removeNonASCII;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/removeNonWord.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/removeNonWord.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161   1         1         1      
var toString = require('../lang/toString');
    // This pattern is generated by the _build/pattern-removeNonWord.js script
    var PATTERN = /[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;
 
    /**
     * Remove non-word chars.
     */
    function removeNonWord(str){
        str = toString(str);
        return str.replace(PATTERN, '');
    }
 
    module.exports = removeNonWord;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/repeat.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/repeat.js

Statements: 26.67% (4 / 15)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 281 1         1                                 1        
var toString = require('../lang/toString');
var toInt = require('../number/toInt');
 
    /**
     * Repeat string n times
     */
     function repeat(str, n){
         var result = '';
         str = toString(str);
         n = toInt(n);
        if (n < 1) {
            return '';
        }
        while (n > 0) {
            if (n % 2) {
                result += str;
            }
            n = Math.floor(n / 2);
            str += str;
        }
        return result;
     }
 
     module.exports = repeat;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/replace.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/replace.js

Statements: 28.57% (4 / 14)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 28.57% (4 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1         1                                               1        
var toString = require('../lang/toString');
var toArray = require('../lang/toArray');
 
    /**
     * Replace string(s) with the replacement(s) in the source.
     */
    function replace(str, search, replacements) {
        str = toString(str);
        search = toArray(search);
        replacements = toArray(replacements);
 
        var searchLength = search.length,
            replacementsLength = replacements.length;
 
        if (replacementsLength !== 1 && searchLength !== replacementsLength) {
            throw new Error('Unequal number of searches and replacements');
        }
 
        var i = -1;
        while (++i < searchLength) {
            // Use the first replacement for all searches if only one
            // replacement is provided
            str = str.replace(
                search[i],
                replacements[(replacementsLength === 1) ? 0 : i]);
        }
 
        return str;
    }
 
    module.exports = replace;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/replaceAccents.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/replaceAccents.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 381       1                                                           1      
var toString = require('../lang/toString');
    /**
    * Replaces all accented chars with regular ones
    */
    function replaceAccents(str){
        str = toString(str);
 
        // verifies if the String has accents and replace them
        if (str.search(/[\xC0-\xFF]/g) > -1) {
            str = str
                    .replace(/[\xC0-\xC5]/g, "A")
                    .replace(/[\xC6]/g, "AE")
                    .replace(/[\xC7]/g, "C")
                    .replace(/[\xC8-\xCB]/g, "E")
                    .replace(/[\xCC-\xCF]/g, "I")
                    .replace(/[\xD0]/g, "D")
                    .replace(/[\xD1]/g, "N")
                    .replace(/[\xD2-\xD6\xD8]/g, "O")
                    .replace(/[\xD9-\xDC]/g, "U")
                    .replace(/[\xDD]/g, "Y")
                    .replace(/[\xDE]/g, "P")
                    .replace(/[\xE0-\xE5]/g, "a")
                    .replace(/[\xE6]/g, "ae")
                    .replace(/[\xE7]/g, "c")
                    .replace(/[\xE8-\xEB]/g, "e")
                    .replace(/[\xEC-\xEF]/g, "i")
                    .replace(/[\xF1]/g, "n")
                    .replace(/[\xF2-\xF6\xF8]/g, "o")
                    .replace(/[\xF9-\xFC]/g, "u")
                    .replace(/[\xFE]/g, "p")
                    .replace(/[\xFD\xFF]/g, "y");
        }
        return str;
    }
    module.exports = replaceAccents;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/rpad.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/rpad.js

Statements: 57.14% (4 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1         1           1        
var toString = require('../lang/toString');
var repeat = require('./repeat');
 
    /**
     * Pad string with `char` if its' length is smaller than `minLen`
     */
    function rpad(str, minLen, ch) {
        str = toString(str);
        ch = ch || ' ';
        return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str;
    }
 
    module.exports = rpad;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/rtrim.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/rtrim.js

Statements: 23.53% (4 / 17)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 23.53% (4 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1       1                                                   1      
var toString = require('../lang/toString');
var WHITE_SPACES = require('./WHITE_SPACES');
    /**
     * Remove chars from end of string.
     */
    function rtrim(str, chars) {
        str = toString(str);
        chars = chars || WHITE_SPACES;
 
        var end = str.length - 1,
            charLen = chars.length,
            found = true,
            i, c;
 
        while (found && end >= 0) {
            found = false;
            i = -1;
            c = str.charAt(end);
 
            while (++i < charLen) {
                if (c === chars[i]) {
                    found = true;
                    end--;
                    break;
                }
            }
        }
 
        return (end >= 0) ? str.substring(0, end + 1) : '';
    }
 
    module.exports = rtrim;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/sentenceCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/sentenceCase.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1       1             1      
var toString = require('../lang/toString');
var lowerCase = require('./lowerCase');
var upperCase = require('./upperCase');
    /**
     * UPPERCASE first char of each sentence and lowercase other chars.
     */
    function sentenceCase(str){
        str = toString(str);
 
        // Replace first char of each sentence (new line or after '.\s+') to
        // UPPERCASE
        return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase);
    }
    module.exports = sentenceCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/slugify.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/slugify.js

Statements: 46.15% (6 / 13)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 46.15% (6 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1 1 1           1                         1      
var toString = require('../lang/toString');
var replaceAccents = require('./replaceAccents');
var removeNonWord = require('./removeNonWord');
var trim = require('./trim');
    /**
     * Convert to lower case, remove accents, remove non-word chars and
     * replace spaces with the specified delimeter.
     * Does not split camelCase text.
     */
    function slugify(str, delimeter){
        str = toString(str);
 
        if (delimeter == null) {
            delimeter = "-";
        }
        str = replaceAccents(str);
        str = removeNonWord(str);
        str = trim(str) //should come after removeNonWord
                .replace(/ +/g, delimeter) //replace spaces with delimeter
                .toLowerCase();
        return str;
    }
    module.exports = slugify;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/startsWith.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/startsWith.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151       1             1      
var toString = require('../lang/toString');
    /**
     * Checks if string starts with specified prefix.
     */
    function startsWith(str, prefix) {
        str = toString(str);
        prefix = toString(prefix);
 
        return str.indexOf(prefix) === 0;
    }
 
    module.exports = startsWith;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/stripHtmlTags.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/stripHtmlTags.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131       1         1      
var toString = require('../lang/toString');
    /**
     * Remove HTML tags from string.
     */
    function stripHtmlTags(str){
        str = toString(str);
 
        return str.replace(/<[^>]*>/g, '');
    }
    module.exports = stripHtmlTags;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/trim.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/trim.js

Statements: 66.67% (6 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 66.67% (6 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1 1       1           1      
var toString = require('../lang/toString');
var WHITE_SPACES = require('./WHITE_SPACES');
var ltrim = require('./ltrim');
var rtrim = require('./rtrim');
    /**
     * Remove white-spaces from beginning and end of string.
     */
    function trim(str, chars) {
        str = toString(str);
        chars = chars || WHITE_SPACES;
        return ltrim(rtrim(str, chars), chars);
    }
 
    module.exports = trim;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/truncate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/truncate.js

Statements: 30.77% (4 / 13)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 30.77% (4 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1       1                           1      
var toString = require('../lang/toString');
var trim = require('./trim');
    /**
     * Limit number of chars.
     */
    function truncate(str, maxChars, append, onlyFullWords){
        str = toString(str);
        append = append || '...';
        maxChars = onlyFullWords? maxChars + 1 : maxChars;
 
        str = trim(str);
        if(str.length <= maxChars){
            return str;
        }
        str = str.substr(0, maxChars - append.length);
        //crop at last space or remove trailing whitespace
        str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str);
        return str + append;
    }
    module.exports = truncate;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/typecast.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/typecast.js

Statements: 18.75% (3 / 16)      Branches: 0% (0 / 16)      Functions: 0% (0 / 1)      Lines: 18.75% (3 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31    1         1                                       1      
 
 
    var UNDEF;
 
    /**
     * Parses string and convert it into a native value.
     */
    function typecast(val) {
        var r;
        if ( val === null || val === 'null' ) {
            r = null;
        } else if ( val === 'true' ) {
            r = true;
        } else if ( val === 'false' ) {
            r = false;
        } else if ( val === UNDEF || val === 'undefined' ) {
            r = UNDEF;
        } else if ( val === '' || isNaN(val) ) {
            //isNaN('') returns false
            r = val;
        } else {
            //parseFloat(null || '') returns NaN
            r = parseFloat(val);
        }
        return r;
    }
 
    module.exports = typecast;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/unCamelCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/unCamelCase.js

Statements: 41.67% (5 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 41.67% (5 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251   1         1         1                 1      
var toString = require('../lang/toString');
 
    var CAMEL_CASE_BORDER = /([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g;
 
    /**
     * Add space between camelCase text.
     */
    function unCamelCase(str, delimiter){
        if (delimiter == null) {
            delimiter = ' ';
        }
 
        function join(str, c1, c2) {
            return c1 + delimiter + c2;
        }
 
        str = toString(str);
        str = str.replace(CAMEL_CASE_BORDER, join);
        str = str.toLowerCase(); //add space between camelCase text
        return str;
    }
    module.exports = unCamelCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/underscore.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/underscore.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1       1         1      
var toString = require('../lang/toString');
var slugify = require('./slugify');
var unCamelCase = require('./unCamelCase');
    /**
     * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case.
     */
    function underscore(str){
        str = toString(str);
        str = unCamelCase(str);
        return slugify(str, "_");
    }
    module.exports = underscore;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/unescapeHtml.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/unescapeHtml.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         1                   1        
var toString = require('../lang/toString');
 
    /**
     * Unescapes HTML special chars
     */
    function unescapeHtml(str){
        str = toString(str)
            .replace(/&amp;/g , '&')
            .replace(/&lt;/g  , '<')
            .replace(/&gt;/g  , '>')
            .replace(/&#0*39;/g , "'")
            .replace(/&quot;/g, '"');
        return str;
    }
 
    module.exports = unescapeHtml;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/unescapeUnicode.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/unescapeUnicode.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181         1               1        
var toString = require('../lang/toString');
 
    /**
     * Unescape unicode char sequences
     */
    function unescapeUnicode(str){
        str = toString(str);
        return str.replace(/\\u[0-9a-f]{4}/g, function(ch){
            var code = parseInt(ch.slice(2), 16);
            return String.fromCharCode(code);
        });
    }
 
    module.exports = unescapeUnicode;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/unhyphenate.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/unhyphenate.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121       1       1      
var toString = require('../lang/toString');
    /**
     * Replaces hyphens with spaces. (only hyphens between word chars)
     */
    function unhyphenate(str){
        str = toString(str);
        return str.replace(/(\w)(-)(\w)/g, '$1 $3');
    }
    module.exports = unhyphenate;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/upperCase.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/string/upperCase.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121       1       1      
var toString = require('../lang/toString');
    /**
     * "Safer" String.toUpperCase()
     */
    function upperCase(str){
        str = toString(str);
        return str.toUpperCase();
    }
    module.exports = upperCase;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/

Statements: 43.75% (14 / 32)      Branches: 4% (1 / 25)      Functions: 0% (0 / 6)      Lines: 43.75% (14 / 32)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/
File Statements Branches Functions Lines
convert.js 23.08% (3 / 13) 0% (0 / 15) 0% (0 / 2) 23.08% (3 / 13)
now.js 60% (3 / 5) 50% (1 / 2) 0% (0 / 2) 60% (3 / 5)
parseMs.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
toTimeString.js 50% (5 / 10) 0% (0 / 8) 0% (0 / 1) 50% (5 / 10)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/convert.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/convert.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 15)      Functions: 0% (0 / 2)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43          1             1                                                   1        
 
 
    /**
     * convert time into another unit
     */
    function convert(val, sourceUnitName, destinationUnitName){
        destinationUnitName = destinationUnitName || 'ms';
        return (val * getUnit(sourceUnitName)) / getUnit(destinationUnitName);
    }
 
 
    //TODO: maybe extract to a separate module
    function getUnit(unitName){
        switch(unitName){
            case 'ms':
            case 'millisecond':
                return 1;
            case 's':
            case 'second':
                 return 1000;
            case 'm':
            case 'minute':
                 return 60000;
            case 'h':
            case 'hour':
                 return 3600000;
            case 'd':
            case 'day':
                 return 86400000;
            case 'w':
            case 'week':
                 return 604800000;
            default:
                throw new Error('"'+ unitName + '" is not a valid unit');
        }
    }
 
 
    module.exports = convert;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/now.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/now.js

Statements: 60% (3 / 5)      Branches: 50% (1 / 2)      Functions: 0% (0 / 2)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20          1           1       1        
 
 
    /**
     * Get current time in miliseconds
     */
    function now(){
        // yes, we defer the work to another function to allow mocking it
        // during the tests
        return now.get();
    }
 
    now.get = (typeof Date.now === 'function')? Date.now : function(){
        return +(new Date());
    };
 
    module.exports = now;
 
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/parseMs.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/parseMs.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191         1                   1      
var countSteps = require('../math/countSteps');
 
    /**
     * Parse timestamp into an object.
     */
    function parseMs(ms){
        return {
            milliseconds : countSteps(ms, 1, 1000),
            seconds      : countSteps(ms, 1000, 60),
            minutes      : countSteps(ms, 60000, 60),
            hours        : countSteps(ms, 3600000, 24),
            days         : countSteps(ms, 86400000)
        };
    }
 
    module.exports = parseMs;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/toTimeString.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/mout/time/toTimeString.js

Statements: 50% (5 / 10)      Branches: 0% (0 / 8)      Functions: 0% (0 / 1)      Lines: 50% (5 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1   1             1                       1      
var countSteps = require('../math/countSteps');
var pad = require('../number/pad');
 
    var HOUR = 3600000,
        MINUTE = 60000,
        SECOND = 1000;
 
    /**
     * Format timestamp into a time string.
     */
    function toTimeString(ms){
        var h = ms < HOUR   ? 0 : countSteps(ms, HOUR),
            m = ms < MINUTE ? 0 : countSteps(ms, MINUTE, 60),
            s = ms < SECOND ? 0 : countSteps(ms, SECOND, 60),
            str = '';
 
        str += h? h + ':' : '';
        str += pad(m, 2) + ':';
        str += pad(s, 2);
 
        return str;
    }
    module.exports = toTimeString;
 
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/once/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/once/

Statements: 53.85% (7 / 13)      Branches: 0% (0 / 2)      Functions: 25% (1 / 4)      Lines: 58.33% (7 / 12)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/once/
File Statements Branches Functions Lines
once.js 53.85% (7 / 13) 0% (0 / 2) 25% (1 / 4) 58.33% (7 / 12)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/once/once.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/once/once.js

Statements: 53.85% (7 / 13)      Branches: 0% (0 / 2)      Functions: 25% (1 / 4)      Lines: 58.33% (7 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231 1   1                 1 1         1 1      
var wrappy = require('wrappy')
module.exports = wrappy(once)
 
once.proto = once(function () {
  Object.defineProperty(Function.prototype, 'once', {
    value: function () {
      return once(this)
    },
    configurable: true
  })
})
 
function once (fn) {
  var f = function () {
    if (f.called) return f.value
    f.called = true
    return f.value = fn.apply(this, arguments)
  }
  f.called = false
  return f
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/optimist/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/optimist/

Statements: 33.72% (58 / 172)      Branches: 14.95% (16 / 107)      Functions: 19.44% (7 / 36)      Lines: 35% (56 / 160)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/optimist/
File Statements Branches Functions Lines
index.js 33.72% (58 / 172) 14.95% (16 / 107) 19.44% (7 / 36) 35% (56 / 160)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/optimist/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/optimist/index.js

Statements: 33.72% (58 / 172)      Branches: 14.95% (16 / 107)      Functions: 19.44% (7 / 36)      Lines: 35% (56 / 160)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 3451 1 1                   1 1 16         1 1 1 1   1     2 2           1           1             1         1         1                       1                       1 1                                 1 1                         1           1 1         1 1                       1       1                                                         1 1         1         1                                                                                                                                                                                                   1 2       1 2 2   2           2 2       2       2                     2     1             1         1 1 2 2   2 2   2 3   2      
var path = require('path');
var minimist = require('minimist');
var wordwrap = require('wordwrap');
 
/*  Hack an instance of Argv with process.argv into Argv
    so people can do
        require('optimist')(['--beeble=1','-z','zizzle']).argv
    to parse a list of args and
        require('optimist').argv
    to get a parsed version of process.argv.
*/
 
var inst = Argv(process.argv.slice(2));
Object.keys(inst).forEach(function (key) {
    Argv[key] = typeof inst[key] == 'function'
        ? inst[key].bind(inst)
        : inst[key];
});
 
var exports = module.exports = Argv;
function Argv (processArgs, cwd) {
    var self = {};
    Eif (!cwd) cwd = process.cwd();
    
    self.$0 = process.argv
        .slice(0,2)
        .map(function (x) {
            var b = rebase(cwd, x);
            return x.match(/^\//) && b.length < x.length
                ? b : x
        })
        .join(' ')
    ;
    
    Iif (process.env._ != undefined && process.argv[1] == process.env._) {
        self.$0 = process.env._.replace(
            path.dirname(process.execPath) + '/', ''
        );
    }
    
    var options = {
        boolean: [],
        string: [],
        alias: {},
        default: []
    };
    
    self.boolean = function (bools) {
        options.boolean.push.apply(options.boolean, [].concat(bools));
        return self;
    };
    
    self.string = function (strings) {
        options.string.push.apply(options.string, [].concat(strings));
        return self;
    };
    
    self.default = function (key, value) {
        if (typeof key === 'object') {
            Object.keys(key).forEach(function (k) {
                self.default(k, key[k]);
            });
        }
        else {
            options.default[key] = value;
        }
        return self;
    };
    
    self.alias = function (x, y) {
        if (typeof x === 'object') {
            Object.keys(x).forEach(function (key) {
                self.alias(key, x[key]);
            });
        }
        else {
            options.alias[x] = (options.alias[x] || []).concat(y);
        }
        return self;
    };
    
    var demanded = {};
    self.demand = function (keys) {
        if (typeof keys == 'number') {
            if (!demanded._) demanded._ = 0;
            demanded._ += keys;
        }
        else if (Array.isArray(keys)) {
            keys.forEach(function (key) {
                self.demand(key);
            });
        }
        else {
            demanded[keys] = true;
        }
        
        return self;
    };
    
    var usage;
    self.usage = function (msg, opts) {
        if (!opts && typeof msg === 'object') {
            opts = msg;
            msg = null;
        }
        
        usage = msg;
        
        if (opts) self.options(opts);
        
        return self;
    };
    
    function fail (msg) {
        self.showHelp();
        if (msg) console.error(msg);
        process.exit(1);
    }
    
    var checks = [];
    self.check = function (f) {
        checks.push(f);
        return self;
    };
    
    var descriptions = {};
    self.describe = function (key, desc) {
        if (typeof key === 'object') {
            Object.keys(key).forEach(function (k) {
                self.describe(k, key[k]);
            });
        }
        else {
            descriptions[key] = desc;
        }
        return self;
    };
    
    self.parse = function (args) {
        return parseArgs(args);
    };
    
    self.option = self.options = function (key, opt) {
        if (typeof key === 'object') {
            Object.keys(key).forEach(function (k) {
                self.options(k, key[k]);
            });
        }
        else {
            if (opt.alias) self.alias(key, opt.alias);
            if (opt.demand) self.demand(key);
            if (typeof opt.default !== 'undefined') {
                self.default(key, opt.default);
            }
            
            if (opt.boolean || opt.type === 'boolean') {
                self.boolean(key);
            }
            if (opt.string || opt.type === 'string') {
                self.string(key);
            }
            
            var desc = opt.describe || opt.description || opt.desc;
            if (desc) {
                self.describe(key, desc);
            }
        }
        
        return self;
    };
    
    var wrap = null;
    self.wrap = function (cols) {
        wrap = cols;
        return self;
    };
    
    self.showHelp = function (fn) {
        if (!fn) fn = console.error;
        fn(self.help());
    };
    
    self.help = function () {
        var keys = Object.keys(
            Object.keys(descriptions)
            .concat(Object.keys(demanded))
            .concat(Object.keys(options.default))
            .reduce(function (acc, key) {
                if (key !== '_') acc[key] = true;
                return acc;
            }, {})
        );
        
        var help = keys.length ? [ 'Options:' ] : [];
        
        if (usage) {
            help.unshift(usage.replace(/\$0/g, self.$0), '');
        }
        
        var switches = keys.reduce(function (acc, key) {
            acc[key] = [ key ].concat(options.alias[key] || [])
                .map(function (sw) {
                    return (sw.length > 1 ? '--' : '-') + sw
                })
                .join(', ')
            ;
            return acc;
        }, {});
        
        var switchlen = longest(Object.keys(switches).map(function (s) {
            return switches[s] || '';
        }));
        
        var desclen = longest(Object.keys(descriptions).map(function (d) { 
            return descriptions[d] || '';
        }));
        
        keys.forEach(function (key) {
            var kswitch = switches[key];
            var desc = descriptions[key] || '';
            
            if (wrap) {
                desc = wordwrap(switchlen + 4, wrap)(desc)
                    .slice(switchlen + 4)
                ;
            }
            
            var spadding = new Array(
                Math.max(switchlen - kswitch.length + 3, 0)
            ).join(' ');
            
            var dpadding = new Array(
                Math.max(desclen - desc.length + 1, 0)
            ).join(' ');
            
            var type = null;
            
            if (options.boolean[key]) type = '[boolean]';
            if (options.string[key]) type = '[string]';
            
            if (!wrap && dpadding.length > 0) {
                desc += dpadding;
            }
            
            var prelude = '  ' + kswitch + spadding;
            var extra = [
                type,
                demanded[key]
                    ? '[required]'
                    : null
                ,
                options.default[key] !== undefined
                    ? '[default: ' + JSON.stringify(options.default[key]) + ']'
                    : null
                ,
            ].filter(Boolean).join('  ');
            
            var body = [ desc, extra ].filter(Boolean).join('  ');
            
            if (wrap) {
                var dlines = desc.split('\n');
                var dlen = dlines.slice(-1)[0].length
                    + (dlines.length === 1 ? prelude.length : 0)
                
                body = desc + (dlen + extra.length > wrap - 2
                    ? '\n'
                        + new Array(wrap - extra.length + 1).join(' ')
                        + extra
                    : new Array(wrap - extra.length - dlen + 1).join(' ')
                        + extra
                );
            }
            
            help.push(prelude + body);
        });
        
        help.push('');
        return help.join('\n');
    };
    
    Object.defineProperty(self, 'argv', {
        get : function () { return parseArgs(processArgs) },
        enumerable : true,
    });
    
    function parseArgs (args) {
        var argv = minimist(args, options);
        argv.$0 = self.$0;
        
        Iif (demanded._ && argv._.length < demanded._) {
            fail('Not enough non-option arguments: got '
                + argv._.length + ', need at least ' + demanded._
            );
        }
        
        var missing = [];
        Object.keys(demanded).forEach(function (key) {
            if (!argv[key]) missing.push(key);
        });
        
        Iif (missing.length) {
            fail('Missing required arguments: ' + missing.join(', '));
        }
        
        checks.forEach(function (f) {
            try {
                if (f(argv) === false) {
                    fail('Argument check failed: ' + f.toString());
                }
            }
            catch (err) {
                fail(err)
            }
        });
        
        return argv;
    }
    
    function longest (xs) {
        return Math.max.apply(
            null,
            xs.map(function (x) { return x.length })
        );
    }
    
    return self;
};
 
// rebase an absolute path to a relative one with respect to a base directory
// exported for tests
exports.rebase = rebase;
function rebase (base, dir) {
    var ds = path.normalize(dir).split('/').slice(1);
    var bs = path.normalize(base).split('/').slice(1);
    
    for (var i = 0; ds[i] && ds[i] == bs[i]; i++);
    ds.splice(0, i); bs.splice(0, i);
    
    var p = path.normalize(
        bs.map(function () { return '..' }).concat(ds).join('/')
    ).replace(/\/$/,'').replace(/^$/, '.');
    return p.match(/^[.\/]/) ? p : './' + p;
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/os-homedir/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/os-homedir/

Statements: 23.08% (3 / 13)      Branches: 3.57% (1 / 28)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/os-homedir/
File Statements Branches Functions Lines
index.js 23.08% (3 / 13) 3.57% (1 / 28) 0% (0 / 1) 23.08% (3 / 13)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/os-homedir/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/os-homedir/index.js

Statements: 23.08% (3 / 13)      Branches: 3.57% (1 / 28)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26  1   1                                       1    
'use strict';
var os = require('os');
 
function homedir() {
	var env = process.env;
	var home = env.HOME;
	var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME;
 
	if (process.platform === 'win32') {
		return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null;
	}
 
	if (process.platform === 'darwin') {
		return home || (user ? '/Users/' + user : null);
	}
 
	if (process.platform === 'linux') {
		return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null));
	}
 
	return home || null;
}
 
module.exports = typeof os.homedir === 'function' ? os.homedir : homedir;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/os-tmpdir/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/os-tmpdir/

Statements: 30% (3 / 10)      Branches: 6.67% (1 / 15)      Functions: 0% (0 / 1)      Lines: 30% (3 / 10)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/os-tmpdir/
File Statements Branches Functions Lines
index.js 30% (3 / 10) 6.67% (1 / 15) 0% (0 / 1) 30% (3 / 10)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/os-tmpdir/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/os-tmpdir/index.js

Statements: 30% (3 / 10)      Branches: 6.67% (1 / 15)      Functions: 0% (0 / 1)      Lines: 30% (3 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27  1 1     1                                          
'use strict';
var isWindows = process.platform === 'win32';
var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
 
// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
module.exports = function () {
	var path;
 
	if (isWindows) {
		path = process.env.TEMP ||
			process.env.TMP ||
			(process.env.SystemRoot || process.env.windir) + '\\temp';
	} else {
		path = process.env.TMPDIR ||
			process.env.TMP ||
			process.env.TEMP ||
			'/tmp';
	}
 
	if (trailingSlashRe.test(path)) {
		path = path.slice(0, -1);
	}
 
	return path;
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/osenv/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/osenv/

Statements: 63.41% (26 / 41)      Branches: 16.67% (6 / 36)      Functions: 41.67% (5 / 12)      Lines: 68.42% (26 / 38)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/osenv/
File Statements Branches Functions Lines
osenv.js 63.41% (26 / 41) 16.67% (6 / 36) 41.67% (5 / 12) 68.42% (26 / 38)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/osenv/osenv.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/osenv/osenv.js

Statements: 63.41% (26 / 41)      Branches: 16.67% (6 / 36)      Functions: 41.67% (5 / 12)      Lines: 68.42% (26 / 38)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 741 1 1 1 1           1 8 8 8 2 2                 2 2 2   2 2       1 1           1       1       1       1 1     1           1           1          
var isWindows = process.platform === 'win32'
var path = require('path')
var exec = require('child_process').exec
var osTmpdir = require('os-tmpdir')
var osHomedir = require('os-homedir')
 
// looking up envs is a bit costly.
// Also, sometimes we want to have a fallback
// Pass in a callback to wait for the fallback on failures
// After the first lookup, always returns the same thing.
function memo (key, lookup, fallback) {
  var fell = false
  var falling = false
  exports[key] = function (cb) {
    var val = lookup()
    Iif (!val && !fell && !falling && fallback) {
      fell = true
      falling = true
      exec(fallback, function (er, output, stderr) {
        falling = false
        if (er) return // oh well, we tried
        val = output.trim()
      })
    }
    exports[key] = function (cb) {
      Iif (cb) process.nextTick(cb.bind(null, null, val))
      return val
    }
    Iif (cb && !falling) process.nextTick(cb.bind(null, null, val))
    return val
  }
}
 
memo('user', function () {
  return ( isWindows
         ? process.env.USERDOMAIN + '\\' + process.env.USERNAME
         : process.env.USER
         )
}, 'whoami')
 
memo('prompt', function () {
  return isWindows ? process.env.PROMPT : process.env.PS1
})
 
memo('hostname', function () {
  return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME
}, 'hostname')
 
memo('tmpdir', function () {
  return osTmpdir()
})
 
memo('home', function () {
  return osHomedir()
})
 
memo('path', function () {
  return (process.env.PATH ||
          process.env.Path ||
          process.env.path).split(isWindows ? ';' : ':')
})
 
memo('editor', function () {
  return process.env.EDITOR ||
         process.env.VISUAL ||
         (isWindows ? 'notepad.exe' : 'vi')
})
 
memo('shell', function () {
  return isWindows ? process.env.ComSpec || 'cmd'
         : process.env.SHELL || 'bash'
})
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/path-is-absolute/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/path-is-absolute/

Statements: 54.55% (6 / 11)      Branches: 12.5% (1 / 8)      Functions: 50% (1 / 2)      Lines: 54.55% (6 / 11)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/path-is-absolute/
File Statements Branches Functions Lines
index.js 54.55% (6 / 11) 12.5% (1 / 8) 50% (1 / 2) 54.55% (6 / 11)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/path-is-absolute/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/path-is-absolute/index.js

Statements: 54.55% (6 / 11)      Branches: 12.5% (1 / 8)      Functions: 50% (1 / 2)      Lines: 54.55% (6 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22    1 3     1                     1 1 1    
'use strict';
 
function posix(path) {
	return path.charAt(0) === '/';
}
 
function win32(path) {
	// https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
	var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
	var result = splitDeviceRe.exec(path);
	var device = result[1] || '';
	var isUnc = Boolean(device && device.charAt(1) !== ':');
 
	// UNC paths are always absolute
	return Boolean(result[2] || isUnc);
}
 
module.exports = process.platform === 'win32' ? win32 : posix;
module.exports.posix = posix;
module.exports.win32 = win32;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/q/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/q/

Statements: 28.19% (221 / 784)      Branches: 9.29% (25 / 269)      Functions: 3.6% (8 / 222)      Lines: 28.26% (221 / 782)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/q/
File Statements Branches Functions Lines
q.js 28.19% (221 / 784) 9.29% (25 / 269) 3.6% (8 / 222) 28.26% (221 / 782)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/q/q.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/q/q.js

Statements: 28.19% (221 / 784)      Branches: 9.29% (25 / 269)      Functions: 3.6% (8 / 222)      Lines: 28.26% (221 / 782)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050                                                        1                 1       1 1                                                                             1 1 1   1         1 1         1       1   1 1 1 1 1   1   1                                               1                                                                       1                         1                   1   1                                                                                       1             1                         1 1 6               1   1                                                         1                       1                     1 1         1   1                   1   1             1                 1 1     1             1   1                                             1                         1         1     2 2         2 2 2                   1                                 1 2       2 2   2 2 2 2       2 2       1 1                                   1                             1           1         1     1                           1 1                                                                                                                             1                                                                                                                 1                                     1 1 1                         1 1 1 1         1           1                             1       1                               1 1                         1                             1 1                                                                                                           1       1           1               1                       1                                                                                         1                               1                                               1 1       1       1       1       1                             1 1                           1 1       1 1               1 1       1               1 1       1             1 1       1                   1 1 1 1   1 1 1   1         1                                         1                                         1   1         1         1               1 1                                                 1 1                                                                             1                                         1 1                                       1 1       1                                                               1 1       1                                                                                                       1 1                                                         1 1                                     1 1                             1 1       1                             1       1                     1       1                   1         1                                   1         1                       1           1                     1       1                 1         1                   1                   1                                 1       1                         1 1                                                                     1                     1   1                         1     1                 1                     1                         1 1                     1             1 1                     1       1                                 1         1                         1 1       1                             1         1                                         1       1                                                                     1       1                                                           1               1                                     1       1                                 1         1                               1                       1             1           1               1                             1         1                                     1                   1                                       1 1       1                               1         1   1        
// vim:ts=4:sts=4:sw=4:
/*!
 *
 * Copyright 2009-2012 Kris Kowal under the terms of the MIT
 * license found at http://github.com/kriskowal/q/raw/master/LICENSE
 *
 * With parts by Tyler Close
 * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found
 * at http://www.opensource.org/licenses/mit-license.html
 * Forked at ref_send.js version: 2009-05-11
 *
 * With parts by Mark Miller
 * Copyright (C) 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
 
(function (definition) {
    "use strict";
 
    // This file will function properly as a <script> tag, or a module
    // using CommonJS and NodeJS or RequireJS module formats.  In
    // Common/Node/RequireJS, the module exports the Q API and when
    // executed as a simple <script>, it creates a Q global instead.
 
    // Montage Require
    Iif (typeof bootstrap === "function") {
        bootstrap("promise", definition);
 
    // CommonJS
    } else Eif (typeof exports === "object" && typeof module === "object") {
        module.exports = definition();
 
    // RequireJS
    } else if (typeof define === "function" && define.amd) {
        define(definition);
 
    // SES (Secure EcmaScript)
    } else if (typeof ses !== "undefined") {
        if (!ses.ok()) {
            return;
        } else {
            ses.makeQ = definition;
        }
 
    // <script>
    } else if (typeof window !== "undefined" || typeof self !== "undefined") {
        // Prefer window over self for add-on scripts. Use self for
        // non-windowed contexts.
        var global = typeof window !== "undefined" ? window : self;
 
        // Get the `window` object, save the previous Q global
        // and initialize Q as a global.
        var previousQ = global.Q;
        global.Q = definition();
 
        // Add a noConflict function so Q can be removed from the
        // global namespace.
        global.Q.noConflict = function () {
            global.Q = previousQ;
            return this;
        };
 
    } else {
        throw new Error("This environment was not anticipated by Q. Please file a bug.");
    }
 
})(function () {
"use strict";
 
var hasStacks = false;
try {
    throw new Error();
} catch (e) {
    hasStacks = !!e.stack;
}
 
// All code after this point will be filtered from stack traces reported
// by Q.
var qStartingLine = captureLine();
var qFileName;
 
// shims
 
// used for fallback in "allResolved"
var noop = function () {};
 
// Use the fastest possible means to execute a task in a future turn
// of the event loop.
var nextTick =(function () {
    // linked list of tasks (single, with head node)
    var head = {task: void 0, next: null};
    var tail = head;
    var flushing = false;
    var requestTick = void 0;
    var isNodeJS = false;
    // queue for late tasks, used by unhandled rejection tracking
    var laterQueue = [];
 
    function flush() {
        /* jshint loopfunc: true */
        var task, domain;
 
        while (head.next) {
            head = head.next;
            task = head.task;
            head.task = void 0;
            domain = head.domain;
 
            if (domain) {
                head.domain = void 0;
                domain.enter();
            }
            runSingle(task, domain);
 
        }
        while (laterQueue.length) {
            task = laterQueue.pop();
            runSingle(task);
        }
        flushing = false;
    }
    // runs a single function in the async queue
    function runSingle(task, domain) {
        try {
            task();
 
        } catch (e) {
            if (isNodeJS) {
                // In node, uncaught exceptions are considered fatal errors.
                // Re-throw them synchronously to interrupt flushing!
 
                // Ensure continuation if the uncaught exception is suppressed
                // listening "uncaughtException" events (as domains does).
                // Continue in next event to avoid tick recursion.
                if (domain) {
                    domain.exit();
                }
                setTimeout(flush, 0);
                if (domain) {
                    domain.enter();
                }
 
                throw e;
 
            } else {
                // In browsers, uncaught exceptions are not fatal.
                // Re-throw them asynchronously to avoid slow-downs.
                setTimeout(function () {
                    throw e;
                }, 0);
            }
        }
 
        if (domain) {
            domain.exit();
        }
    }
 
    nextTick = function (task) {
        tail = tail.next = {
            task: task,
            domain: isNodeJS && process.domain,
            next: null
        };
 
        if (!flushing) {
            flushing = true;
            requestTick();
        }
    };
 
    Eif (typeof process === "object" &&
        process.toString() === "[object process]" && process.nextTick) {
        // Ensure Q is in a real Node environment, with a `process.nextTick`.
        // To see through fake Node environments:
        // * Mocha test runner - exposes a `process` global without a `nextTick`
        // * Browserify - exposes a `process.nexTick` function that uses
        //   `setTimeout`. In this case `setImmediate` is preferred because
        //    it is faster. Browserify's `process.toString()` yields
        //   "[object Object]", while in a real Node environment
        //   `process.nextTick()` yields "[object process]".
        isNodeJS = true;
 
        requestTick = function () {
            process.nextTick(flush);
        };
 
    } else if (typeof setImmediate === "function") {
        // In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate
        if (typeof window !== "undefined") {
            requestTick = setImmediate.bind(window, flush);
        } else {
            requestTick = function () {
                setImmediate(flush);
            };
        }
 
    } else if (typeof MessageChannel !== "undefined") {
        // modern browsers
        // http://www.nonblocking.io/2011/06/windownexttick.html
        var channel = new MessageChannel();
        // At least Safari Version 6.0.5 (8536.30.1) intermittently cannot create
        // working message ports the first time a page loads.
        channel.port1.onmessage = function () {
            requestTick = requestPortTick;
            channel.port1.onmessage = flush;
            flush();
        };
        var requestPortTick = function () {
            // Opera requires us to provide a message payload, regardless of
            // whether we use it.
            channel.port2.postMessage(0);
        };
        requestTick = function () {
            setTimeout(flush, 0);
            requestPortTick();
        };
 
    } else {
        // old browsers
        requestTick = function () {
            setTimeout(flush, 0);
        };
    }
    // runs a task after all other tasks have been run
    // this is useful for unhandled rejection tracking that needs to happen
    // after all `then`d tasks have been run.
    nextTick.runAfter = function (task) {
        laterQueue.push(task);
        if (!flushing) {
            flushing = true;
            requestTick();
        }
    };
    return nextTick;
})();
 
// Attempt to make generics safe in the face of downstream
// modifications.
// There is no situation where this is necessary.
// If you need a security guarantee, these primordials need to be
// deeply frozen anyway, and if you don’t need a security guarantee,
// this is just plain paranoid.
// However, this **might** have the nice side-effect of reducing the size of
// the minified code by reducing x.call() to merely x()
// See Mark Miller’s explanation of what this does.
// http://wiki.ecmascript.org/doku.php?id=conventions:safe_meta_programming
var call = Function.call;
function uncurryThis(f) {
    return function () {
        return call.apply(f, arguments);
    };
}
// This is equivalent, but slower:
// uncurryThis = Function_bind.bind(Function_bind.call);
// http://jsperf.com/uncurrythis
 
var array_slice = uncurryThis(Array.prototype.slice);
 
var array_reduce = uncurryThis(
    Array.prototype.reduce || function (callback, basis) {
        var index = 0,
            length = this.length;
        // concerning the initial value, if one is not provided
        if (arguments.length === 1) {
            // seek to the first value in the array, accounting
            // for the possibility that is is a sparse array
            do {
                if (index in this) {
                    basis = this[index++];
                    break;
                }
                if (++index >= length) {
                    throw new TypeError();
                }
            } while (1);
        }
        // reduce
        for (; index < length; index++) {
            // account for the possibility that the array is sparse
            if (index in this) {
                basis = callback(basis, this[index], index);
            }
        }
        return basis;
    }
);
 
var array_indexOf = uncurryThis(
    Array.prototype.indexOf || function (value) {
        // not a very good shim, but good enough for our one use of it
        for (var i = 0; i < this.length; i++) {
            if (this[i] === value) {
                return i;
            }
        }
        return -1;
    }
);
 
var array_map = uncurryThis(
    Array.prototype.map || function (callback, thisp) {
        var self = this;
        var collect = [];
        array_reduce(self, function (undefined, value, index) {
            collect.push(callback.call(thisp, value, index, self));
        }, void 0);
        return collect;
    }
);
 
var object_create = Object.create || function (prototype) {
    function Type() { }
    Type.prototype = prototype;
    return new Type();
};
 
var object_hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);
 
var object_keys = Object.keys || function (object) {
    var keys = [];
    for (var key in object) {
        if (object_hasOwnProperty(object, key)) {
            keys.push(key);
        }
    }
    return keys;
};
 
var object_toString = uncurryThis(Object.prototype.toString);
 
function isObject(value) {
    return value === Object(value);
}
 
// generator related shims
 
// FIXME: Remove this function once ES6 generators are in SpiderMonkey.
function isStopIteration(exception) {
    return (
        object_toString(exception) === "[object StopIteration]" ||
        exception instanceof QReturnValue
    );
}
 
// FIXME: Remove this helper and Q.return once ES6 generators are in
// SpiderMonkey.
var QReturnValue;
Iif (typeof ReturnValue !== "undefined") {
    QReturnValue = ReturnValue;
} else {
    QReturnValue = function (value) {
        this.value = value;
    };
}
 
// long stack traces
 
var STACK_JUMP_SEPARATOR = "From previous event:";
 
function makeStackTraceLong(error, promise) {
    // If possible, transform the error stack trace by removing Node and Q
    // cruft, then concatenating with the stack trace of `promise`. See #57.
    if (hasStacks &&
        promise.stack &&
        typeof error === "object" &&
        error !== null &&
        error.stack &&
        error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
    ) {
        var stacks = [];
        for (var p = promise; !!p; p = p.source) {
            if (p.stack) {
                stacks.unshift(p.stack);
            }
        }
        stacks.unshift(error.stack);
 
        var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
        error.stack = filterStackString(concatedStacks);
    }
}
 
function filterStackString(stackString) {
    var lines = stackString.split("\n");
    var desiredLines = [];
    for (var i = 0; i < lines.length; ++i) {
        var line = lines[i];
 
        if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
            desiredLines.push(line);
        }
    }
    return desiredLines.join("\n");
}
 
function isNodeFrame(stackLine) {
    return stackLine.indexOf("(module.js:") !== -1 ||
           stackLine.indexOf("(node.js:") !== -1;
}
 
function getFileNameAndLineNumber(stackLine) {
    // Named functions: "at functionName (filename:lineNumber:columnNumber)"
    // In IE10 function name can have spaces ("Anonymous function") O_o
    var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
    Iif (attempt1) {
        return [attempt1[1], Number(attempt1[2])];
    }
 
    // Anonymous functions: "at filename:lineNumber:columnNumber"
    var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
    Eif (attempt2) {
        return [attempt2[1], Number(attempt2[2])];
    }
 
    // Firefox style: "function@filename:lineNumber or @filename:lineNumber"
    var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
    if (attempt3) {
        return [attempt3[1], Number(attempt3[2])];
    }
}
 
function isInternalFrame(stackLine) {
    var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
 
    if (!fileNameAndLineNumber) {
        return false;
    }
 
    var fileName = fileNameAndLineNumber[0];
    var lineNumber = fileNameAndLineNumber[1];
 
    return fileName === qFileName &&
        lineNumber >= qStartingLine &&
        lineNumber <= qEndingLine;
}
 
// discover own file name and line number range for filtering stack
// traces
function captureLine() {
    Iif (!hasStacks) {
        return;
    }
 
    try {
        throw new Error();
    } catch (e) {
        var lines = e.stack.split("\n");
        var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
        var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
        Iif (!fileNameAndLineNumber) {
            return;
        }
 
        qFileName = fileNameAndLineNumber[0];
        return fileNameAndLineNumber[1];
    }
}
 
function deprecate(callback, name, alternative) {
    return function () {
        if (typeof console !== "undefined" &&
            typeof console.warn === "function") {
            console.warn(name + " is deprecated, use " + alternative +
                         " instead.", new Error("").stack);
        }
        return callback.apply(callback, arguments);
    };
}
 
// end of shims
// beginning of real work
 
/**
 * Constructs a promise for an immediate reference, passes promises through, or
 * coerces promises from different systems.
 * @param value immediate reference or promise
 */
function Q(value) {
    // If the object is already a Promise, return it directly.  This enables
    // the resolve function to both be used to created references from objects,
    // but to tolerably coerce non-promises to promises.
    if (value instanceof Promise) {
        return value;
    }
 
    // assimilate thenables
    if (isPromiseAlike(value)) {
        return coerce(value);
    } else {
        return fulfill(value);
    }
}
Q.resolve = Q;
 
/**
 * Performs a task in a future turn of the event loop.
 * @param {Function} task
 */
Q.nextTick = nextTick;
 
/**
 * Controls whether or not long stack traces will be on
 */
Q.longStackSupport = false;
 
// enable long stacks if Q_DEBUG is set
Iif (typeof process === "object" && process && process.env && process.env.Q_DEBUG) {
    Q.longStackSupport = true;
}
 
/**
 * Constructs a {promise, resolve, reject} object.
 *
 * `resolve` is a callback to invoke with a more resolved value for the
 * promise. To fulfill the promise, invoke `resolve` with any value that is
 * not a thenable. To reject the promise, invoke `resolve` with a rejected
 * thenable, or invoke `reject` with the reason directly. To resolve the
 * promise to another thenable, thus putting it in the same state, invoke
 * `resolve` with that other thenable.
 */
Q.defer = defer;
function defer() {
    // if "messages" is an "Array", that indicates that the promise has not yet
    // been resolved.  If it is "undefined", it has been resolved.  Each
    // element of the messages array is itself an array of complete arguments to
    // forward to the resolved promise.  We coerce the resolution value to a
    // promise using the `resolve` function because it handles both fully
    // non-thenable values and other thenables gracefully.
    var messages = [], progressListeners = [], resolvedPromise;
 
    var deferred = object_create(defer.prototype);
    var promise = object_create(Promise.prototype);
 
    promise.promiseDispatch = function (resolve, op, operands) {
        var args = array_slice(arguments);
        if (messages) {
            messages.push(args);
            if (op === "when" && operands[1]) { // progress operand
                progressListeners.push(operands[1]);
            }
        } else {
            Q.nextTick(function () {
                resolvedPromise.promiseDispatch.apply(resolvedPromise, args);
            });
        }
    };
 
    // XXX deprecated
    promise.valueOf = function () {
        if (messages) {
            return promise;
        }
        var nearerValue = nearer(resolvedPromise);
        if (isPromise(nearerValue)) {
            resolvedPromise = nearerValue; // shorten chain
        }
        return nearerValue;
    };
 
    promise.inspect = function () {
        if (!resolvedPromise) {
            return { state: "pending" };
        }
        return resolvedPromise.inspect();
    };
 
    if (Q.longStackSupport && hasStacks) {
        try {
            throw new Error();
        } catch (e) {
            // NOTE: don't try to use `Error.captureStackTrace` or transfer the
            // accessor around; that causes memory leaks as per GH-111. Just
            // reify the stack trace as a string ASAP.
            //
            // At the same time, cut off the first line; it's always just
            // "[object Promise]\n", as per the `toString`.
            promise.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
        }
    }
 
    // NOTE: we do the checks for `resolvedPromise` in each method, instead of
    // consolidating them into `become`, since otherwise we'd create new
    // promises with the lines `become(whatever(value))`. See e.g. GH-252.
 
    function become(newPromise) {
        resolvedPromise = newPromise;
        promise.source = newPromise;
 
        array_reduce(messages, function (undefined, message) {
            Q.nextTick(function () {
                newPromise.promiseDispatch.apply(newPromise, message);
            });
        }, void 0);
 
        messages = void 0;
        progressListeners = void 0;
    }
 
    deferred.promise = promise;
    deferred.resolve = function (value) {
        if (resolvedPromise) {
            return;
        }
 
        become(Q(value));
    };
 
    deferred.fulfill = function (value) {
        if (resolvedPromise) {
            return;
        }
 
        become(fulfill(value));
    };
    deferred.reject = function (reason) {
        if (resolvedPromise) {
            return;
        }
 
        become(reject(reason));
    };
    deferred.notify = function (progress) {
        if (resolvedPromise) {
            return;
        }
 
        array_reduce(progressListeners, function (undefined, progressListener) {
            Q.nextTick(function () {
                progressListener(progress);
            });
        }, void 0);
    };
 
    return deferred;
}
 
/**
 * Creates a Node-style callback that will resolve or reject the deferred
 * promise.
 * @returns a nodeback
 */
defer.prototype.makeNodeResolver = function () {
    var self = this;
    return function (error, value) {
        if (error) {
            self.reject(error);
        } else if (arguments.length > 2) {
            self.resolve(array_slice(arguments, 1));
        } else {
            self.resolve(value);
        }
    };
};
 
/**
 * @param resolver {Function} a function that returns nothing and accepts
 * the resolve, reject, and notify functions for a deferred.
 * @returns a promise that may be resolved with the given resolve and reject
 * functions, or rejected by a thrown exception in resolver
 */
Q.Promise = promise; // ES6
Q.promise = promise;
function promise(resolver) {
    if (typeof resolver !== "function") {
        throw new TypeError("resolver must be a function.");
    }
    var deferred = defer();
    try {
        resolver(deferred.resolve, deferred.reject, deferred.notify);
    } catch (reason) {
        deferred.reject(reason);
    }
    return deferred.promise;
}
 
promise.race = race; // ES6
promise.all = all; // ES6
promise.reject = reject; // ES6
promise.resolve = Q; // ES6
 
// XXX experimental.  This method is a way to denote that a local value is
// serializable and should be immediately dispatched to a remote upon request,
// instead of passing a reference.
Q.passByCopy = function (object) {
    //freeze(object);
    //passByCopies.set(object, true);
    return object;
};
 
Promise.prototype.passByCopy = function () {
    //freeze(object);
    //passByCopies.set(object, true);
    return this;
};
 
/**
 * If two promises eventually fulfill to the same value, promises that value,
 * but otherwise rejects.
 * @param x {Any*}
 * @param y {Any*}
 * @returns {Any*} a promise for x and y if they are the same, but a rejection
 * otherwise.
 *
 */
Q.join = function (x, y) {
    return Q(x).join(y);
};
 
Promise.prototype.join = function (that) {
    return Q([this, that]).spread(function (x, y) {
        if (x === y) {
            // TODO: "===" should be Object.is or equiv
            return x;
        } else {
            throw new Error("Can't join: not the same: " + x + " " + y);
        }
    });
};
 
/**
 * Returns a promise for the first of an array of promises to become settled.
 * @param answers {Array[Any*]} promises to race
 * @returns {Any*} the first promise to be settled
 */
Q.race = race;
function race(answerPs) {
    return promise(function (resolve, reject) {
        // Switch to this once we can assume at least ES5
        // answerPs.forEach(function (answerP) {
        //     Q(answerP).then(resolve, reject);
        // });
        // Use this in the meantime
        for (var i = 0, len = answerPs.length; i < len; i++) {
            Q(answerPs[i]).then(resolve, reject);
        }
    });
}
 
Promise.prototype.race = function () {
    return this.then(Q.race);
};
 
/**
 * Constructs a Promise with a promise descriptor object and optional fallback
 * function.  The descriptor contains methods like when(rejected), get(name),
 * set(name, value), post(name, args), and delete(name), which all
 * return either a value, a promise for a value, or a rejection.  The fallback
 * accepts the operation name, a resolver, and any further arguments that would
 * have been forwarded to the appropriate method above had a method been
 * provided with the proper name.  The API makes no guarantees about the nature
 * of the returned object, apart from that it is usable whereever promises are
 * bought and sold.
 */
Q.makePromise = Promise;
function Promise(descriptor, fallback, inspect) {
    if (fallback === void 0) {
        fallback = function (op) {
            return reject(new Error(
                "Promise does not support operation: " + op
            ));
        };
    }
    if (inspect === void 0) {
        inspect = function () {
            return {state: "unknown"};
        };
    }
 
    var promise = object_create(Promise.prototype);
 
    promise.promiseDispatch = function (resolve, op, args) {
        var result;
        try {
            if (descriptor[op]) {
                result = descriptor[op].apply(promise, args);
            } else {
                result = fallback.call(promise, op, args);
            }
        } catch (exception) {
            result = reject(exception);
        }
        if (resolve) {
            resolve(result);
        }
    };
 
    promise.inspect = inspect;
 
    // XXX deprecated `valueOf` and `exception` support
    if (inspect) {
        var inspected = inspect();
        if (inspected.state === "rejected") {
            promise.exception = inspected.reason;
        }
 
        promise.valueOf = function () {
            var inspected = inspect();
            if (inspected.state === "pending" ||
                inspected.state === "rejected") {
                return promise;
            }
            return inspected.value;
        };
    }
 
    return promise;
}
 
Promise.prototype.toString = function () {
    return "[object Promise]";
};
 
Promise.prototype.then = function (fulfilled, rejected, progressed) {
    var self = this;
    var deferred = defer();
    var done = false;   // ensure the untrusted promise makes at most a
                        // single call to one of the callbacks
 
    function _fulfilled(value) {
        try {
            return typeof fulfilled === "function" ? fulfilled(value) : value;
        } catch (exception) {
            return reject(exception);
        }
    }
 
    function _rejected(exception) {
        if (typeof rejected === "function") {
            makeStackTraceLong(exception, self);
            try {
                return rejected(exception);
            } catch (newException) {
                return reject(newException);
            }
        }
        return reject(exception);
    }
 
    function _progressed(value) {
        return typeof progressed === "function" ? progressed(value) : value;
    }
 
    Q.nextTick(function () {
        self.promiseDispatch(function (value) {
            if (done) {
                return;
            }
            done = true;
 
            deferred.resolve(_fulfilled(value));
        }, "when", [function (exception) {
            if (done) {
                return;
            }
            done = true;
 
            deferred.resolve(_rejected(exception));
        }]);
    });
 
    // Progress propagator need to be attached in the current tick.
    self.promiseDispatch(void 0, "when", [void 0, function (value) {
        var newValue;
        var threw = false;
        try {
            newValue = _progressed(value);
        } catch (e) {
            threw = true;
            if (Q.onerror) {
                Q.onerror(e);
            } else {
                throw e;
            }
        }
 
        if (!threw) {
            deferred.notify(newValue);
        }
    }]);
 
    return deferred.promise;
};
 
Q.tap = function (promise, callback) {
    return Q(promise).tap(callback);
};
 
/**
 * Works almost like "finally", but not called for rejections.
 * Original resolution value is passed through callback unaffected.
 * Callback may return a promise that will be awaited for.
 * @param {Function} callback
 * @returns {Q.Promise}
 * @example
 * doSomething()
 *   .then(...)
 *   .tap(console.log)
 *   .then(...);
 */
Promise.prototype.tap = function (callback) {
    callback = Q(callback);
 
    return this.then(function (value) {
        return callback.fcall(value).thenResolve(value);
    });
};
 
/**
 * Registers an observer on a promise.
 *
 * Guarantees:
 *
 * 1. that fulfilled and rejected will be called only once.
 * 2. that either the fulfilled callback or the rejected callback will be
 *    called, but not both.
 * 3. that fulfilled and rejected will not be called in this turn.
 *
 * @param value      promise or immediate reference to observe
 * @param fulfilled  function to be called with the fulfilled value
 * @param rejected   function to be called with the rejection exception
 * @param progressed function to be called on any progress notifications
 * @return promise for the return value from the invoked callback
 */
Q.when = when;
function when(value, fulfilled, rejected, progressed) {
    return Q(value).then(fulfilled, rejected, progressed);
}
 
Promise.prototype.thenResolve = function (value) {
    return this.then(function () { return value; });
};
 
Q.thenResolve = function (promise, value) {
    return Q(promise).thenResolve(value);
};
 
Promise.prototype.thenReject = function (reason) {
    return this.then(function () { throw reason; });
};
 
Q.thenReject = function (promise, reason) {
    return Q(promise).thenReject(reason);
};
 
/**
 * If an object is not a promise, it is as "near" as possible.
 * If a promise is rejected, it is as "near" as possible too.
 * If it’s a fulfilled promise, the fulfillment value is nearer.
 * If it’s a deferred promise and the deferred has been resolved, the
 * resolution is "nearer".
 * @param object
 * @returns most resolved (nearest) form of the object
 */
 
// XXX should we re-do this?
Q.nearer = nearer;
function nearer(value) {
    if (isPromise(value)) {
        var inspected = value.inspect();
        if (inspected.state === "fulfilled") {
            return inspected.value;
        }
    }
    return value;
}
 
/**
 * @returns whether the given object is a promise.
 * Otherwise it is a fulfilled value.
 */
Q.isPromise = isPromise;
function isPromise(object) {
    return object instanceof Promise;
}
 
Q.isPromiseAlike = isPromiseAlike;
function isPromiseAlike(object) {
    return isObject(object) && typeof object.then === "function";
}
 
/**
 * @returns whether the given object is a pending promise, meaning not
 * fulfilled or rejected.
 */
Q.isPending = isPending;
function isPending(object) {
    return isPromise(object) && object.inspect().state === "pending";
}
 
Promise.prototype.isPending = function () {
    return this.inspect().state === "pending";
};
 
/**
 * @returns whether the given object is a value or fulfilled
 * promise.
 */
Q.isFulfilled = isFulfilled;
function isFulfilled(object) {
    return !isPromise(object) || object.inspect().state === "fulfilled";
}
 
Promise.prototype.isFulfilled = function () {
    return this.inspect().state === "fulfilled";
};
 
/**
 * @returns whether the given object is a rejected promise.
 */
Q.isRejected = isRejected;
function isRejected(object) {
    return isPromise(object) && object.inspect().state === "rejected";
}
 
Promise.prototype.isRejected = function () {
    return this.inspect().state === "rejected";
};
 
//// BEGIN UNHANDLED REJECTION TRACKING
 
// This promise library consumes exceptions thrown in handlers so they can be
// handled by a subsequent promise.  The exceptions get added to this array when
// they are created, and removed when they are handled.  Note that in ES6 or
// shimmed environments, this would naturally be a `Set`.
var unhandledReasons = [];
var unhandledRejections = [];
var reportedUnhandledRejections = [];
var trackUnhandledRejections = true;
 
function resetUnhandledRejections() {
    unhandledReasons.length = 0;
    unhandledRejections.length = 0;
 
    Iif (!trackUnhandledRejections) {
        trackUnhandledRejections = true;
    }
}
 
function trackRejection(promise, reason) {
    if (!trackUnhandledRejections) {
        return;
    }
    if (typeof process === "object" && typeof process.emit === "function") {
        Q.nextTick.runAfter(function () {
            if (array_indexOf(unhandledRejections, promise) !== -1) {
                process.emit("unhandledRejection", reason, promise);
                reportedUnhandledRejections.push(promise);
            }
        });
    }
 
    unhandledRejections.push(promise);
    if (reason && typeof reason.stack !== "undefined") {
        unhandledReasons.push(reason.stack);
    } else {
        unhandledReasons.push("(no stack) " + reason);
    }
}
 
function untrackRejection(promise) {
    if (!trackUnhandledRejections) {
        return;
    }
 
    var at = array_indexOf(unhandledRejections, promise);
    if (at !== -1) {
        if (typeof process === "object" && typeof process.emit === "function") {
            Q.nextTick.runAfter(function () {
                var atReport = array_indexOf(reportedUnhandledRejections, promise);
                if (atReport !== -1) {
                    process.emit("rejectionHandled", unhandledReasons[at], promise);
                    reportedUnhandledRejections.splice(atReport, 1);
                }
            });
        }
        unhandledRejections.splice(at, 1);
        unhandledReasons.splice(at, 1);
    }
}
 
Q.resetUnhandledRejections = resetUnhandledRejections;
 
Q.getUnhandledReasons = function () {
    // Make a copy so that consumers can't interfere with our internal state.
    return unhandledReasons.slice();
};
 
Q.stopUnhandledRejectionTracking = function () {
    resetUnhandledRejections();
    trackUnhandledRejections = false;
};
 
resetUnhandledRejections();
 
//// END UNHANDLED REJECTION TRACKING
 
/**
 * Constructs a rejected promise.
 * @param reason value describing the failure
 */
Q.reject = reject;
function reject(reason) {
    var rejection = Promise({
        "when": function (rejected) {
            // note that the error has been handled
            if (rejected) {
                untrackRejection(this);
            }
            return rejected ? rejected(reason) : this;
        }
    }, function fallback() {
        return this;
    }, function inspect() {
        return { state: "rejected", reason: reason };
    });
 
    // Note that the reason has not been handled.
    trackRejection(rejection, reason);
 
    return rejection;
}
 
/**
 * Constructs a fulfilled promise for an immediate reference.
 * @param value immediate reference
 */
Q.fulfill = fulfill;
function fulfill(value) {
    return Promise({
        "when": function () {
            return value;
        },
        "get": function (name) {
            return value[name];
        },
        "set": function (name, rhs) {
            value[name] = rhs;
        },
        "delete": function (name) {
            delete value[name];
        },
        "post": function (name, args) {
            // Mark Miller proposes that post with no name should apply a
            // promised function.
            if (name === null || name === void 0) {
                return value.apply(void 0, args);
            } else {
                return value[name].apply(value, args);
            }
        },
        "apply": function (thisp, args) {
            return value.apply(thisp, args);
        },
        "keys": function () {
            return object_keys(value);
        }
    }, void 0, function inspect() {
        return { state: "fulfilled", value: value };
    });
}
 
/**
 * Converts thenables to Q promises.
 * @param promise thenable promise
 * @returns a Q promise
 */
function coerce(promise) {
    var deferred = defer();
    Q.nextTick(function () {
        try {
            promise.then(deferred.resolve, deferred.reject, deferred.notify);
        } catch (exception) {
            deferred.reject(exception);
        }
    });
    return deferred.promise;
}
 
/**
 * Annotates an object such that it will never be
 * transferred away from this process over any promise
 * communication channel.
 * @param object
 * @returns promise a wrapping of that object that
 * additionally responds to the "isDef" message
 * without a rejection.
 */
Q.master = master;
function master(object) {
    return Promise({
        "isDef": function () {}
    }, function fallback(op, args) {
        return dispatch(object, op, args);
    }, function () {
        return Q(object).inspect();
    });
}
 
/**
 * Spreads the values of a promised array of arguments into the
 * fulfillment callback.
 * @param fulfilled callback that receives variadic arguments from the
 * promised array
 * @param rejected callback that receives the exception if the promise
 * is rejected.
 * @returns a promise for the return value or thrown exception of
 * either callback.
 */
Q.spread = spread;
function spread(value, fulfilled, rejected) {
    return Q(value).spread(fulfilled, rejected);
}
 
Promise.prototype.spread = function (fulfilled, rejected) {
    return this.all().then(function (array) {
        return fulfilled.apply(void 0, array);
    }, rejected);
};
 
/**
 * The async function is a decorator for generator functions, turning
 * them into asynchronous generators.  Although generators are only part
 * of the newest ECMAScript 6 drafts, this code does not cause syntax
 * errors in older engines.  This code should continue to work and will
 * in fact improve over time as the language improves.
 *
 * ES6 generators are currently part of V8 version 3.19 with the
 * --harmony-generators runtime flag enabled.  SpiderMonkey has had them
 * for longer, but under an older Python-inspired form.  This function
 * works on both kinds of generators.
 *
 * Decorates a generator function such that:
 *  - it may yield promises
 *  - execution will continue when that promise is fulfilled
 *  - the value of the yield expression will be the fulfilled value
 *  - it returns a promise for the return value (when the generator
 *    stops iterating)
 *  - the decorated function returns a promise for the return value
 *    of the generator or the first rejected promise among those
 *    yielded.
 *  - if an error is thrown in the generator, it propagates through
 *    every following yield until it is caught, or until it escapes
 *    the generator function altogether, and is translated into a
 *    rejection for the promise returned by the decorated generator.
 */
Q.async = async;
function async(makeGenerator) {
    return function () {
        // when verb is "send", arg is a value
        // when verb is "throw", arg is an exception
        function continuer(verb, arg) {
            var result;
 
            // Until V8 3.19 / Chromium 29 is released, SpiderMonkey is the only
            // engine that has a deployed base of browsers that support generators.
            // However, SM's generators use the Python-inspired semantics of
            // outdated ES6 drafts.  We would like to support ES6, but we'd also
            // like to make it possible to use generators in deployed browsers, so
            // we also support Python-style generators.  At some point we can remove
            // this block.
 
            if (typeof StopIteration === "undefined") {
                // ES6 Generators
                try {
                    result = generator[verb](arg);
                } catch (exception) {
                    return reject(exception);
                }
                if (result.done) {
                    return Q(result.value);
                } else {
                    return when(result.value, callback, errback);
                }
            } else {
                // SpiderMonkey Generators
                // FIXME: Remove this case when SM does ES6 generators.
                try {
                    result = generator[verb](arg);
                } catch (exception) {
                    if (isStopIteration(exception)) {
                        return Q(exception.value);
                    } else {
                        return reject(exception);
                    }
                }
                return when(result, callback, errback);
            }
        }
        var generator = makeGenerator.apply(this, arguments);
        var callback = continuer.bind(continuer, "next");
        var errback = continuer.bind(continuer, "throw");
        return callback();
    };
}
 
/**
 * The spawn function is a small wrapper around async that immediately
 * calls the generator and also ends the promise chain, so that any
 * unhandled errors are thrown instead of forwarded to the error
 * handler. This is useful because it's extremely common to run
 * generators at the top-level to work with libraries.
 */
Q.spawn = spawn;
function spawn(makeGenerator) {
    Q.done(Q.async(makeGenerator)());
}
 
// FIXME: Remove this interface once ES6 generators are in SpiderMonkey.
/**
 * Throws a ReturnValue exception to stop an asynchronous generator.
 *
 * This interface is a stop-gap measure to support generator return
 * values in older Firefox/SpiderMonkey.  In browsers that support ES6
 * generators like Chromium 29, just use "return" in your generator
 * functions.
 *
 * @param value the return value for the surrounding generator
 * @throws ReturnValue exception with the value.
 * @example
 * // ES6 style
 * Q.async(function* () {
 *      var foo = yield getFooPromise();
 *      var bar = yield getBarPromise();
 *      return foo + bar;
 * })
 * // Older SpiderMonkey style
 * Q.async(function () {
 *      var foo = yield getFooPromise();
 *      var bar = yield getBarPromise();
 *      Q.return(foo + bar);
 * })
 */
Q["return"] = _return;
function _return(value) {
    throw new QReturnValue(value);
}
 
/**
 * The promised function decorator ensures that any promise arguments
 * are settled and passed as values (`this` is also settled and passed
 * as a value).  It will also ensure that the result of a function is
 * always a promise.
 *
 * @example
 * var add = Q.promised(function (a, b) {
 *     return a + b;
 * });
 * add(Q(a), Q(B));
 *
 * @param {function} callback The function to decorate
 * @returns {function} a function that has been decorated.
 */
Q.promised = promised;
function promised(callback) {
    return function () {
        return spread([this, all(arguments)], function (self, args) {
            return callback.apply(self, args);
        });
    };
}
 
/**
 * sends a message to a value in a future turn
 * @param object* the recipient
 * @param op the name of the message operation, e.g., "when",
 * @param args further arguments to be forwarded to the operation
 * @returns result {Promise} a promise for the result of the operation
 */
Q.dispatch = dispatch;
function dispatch(object, op, args) {
    return Q(object).dispatch(op, args);
}
 
Promise.prototype.dispatch = function (op, args) {
    var self = this;
    var deferred = defer();
    Q.nextTick(function () {
        self.promiseDispatch(deferred.resolve, op, args);
    });
    return deferred.promise;
};
 
/**
 * Gets the value of a property in a future turn.
 * @param object    promise or immediate reference for target object
 * @param name      name of property to get
 * @return promise for the property value
 */
Q.get = function (object, key) {
    return Q(object).dispatch("get", [key]);
};
 
Promise.prototype.get = function (key) {
    return this.dispatch("get", [key]);
};
 
/**
 * Sets the value of a property in a future turn.
 * @param object    promise or immediate reference for object object
 * @param name      name of property to set
 * @param value     new value of property
 * @return promise for the return value
 */
Q.set = function (object, key, value) {
    return Q(object).dispatch("set", [key, value]);
};
 
Promise.prototype.set = function (key, value) {
    return this.dispatch("set", [key, value]);
};
 
/**
 * Deletes a property in a future turn.
 * @param object    promise or immediate reference for target object
 * @param name      name of property to delete
 * @return promise for the return value
 */
Q.del = // XXX legacy
Q["delete"] = function (object, key) {
    return Q(object).dispatch("delete", [key]);
};
 
Promise.prototype.del = // XXX legacy
Promise.prototype["delete"] = function (key) {
    return this.dispatch("delete", [key]);
};
 
/**
 * Invokes a method in a future turn.
 * @param object    promise or immediate reference for target object
 * @param name      name of method to invoke
 * @param value     a value to post, typically an array of
 *                  invocation arguments for promises that
 *                  are ultimately backed with `resolve` values,
 *                  as opposed to those backed with URLs
 *                  wherein the posted value can be any
 *                  JSON serializable object.
 * @return promise for the return value
 */
// bound locally because it is used by other methods
Q.mapply = // XXX As proposed by "Redsandro"
Q.post = function (object, name, args) {
    return Q(object).dispatch("post", [name, args]);
};
 
Promise.prototype.mapply = // XXX As proposed by "Redsandro"
Promise.prototype.post = function (name, args) {
    return this.dispatch("post", [name, args]);
};
 
/**
 * Invokes a method in a future turn.
 * @param object    promise or immediate reference for target object
 * @param name      name of method to invoke
 * @param ...args   array of invocation arguments
 * @return promise for the return value
 */
Q.send = // XXX Mark Miller's proposed parlance
Q.mcall = // XXX As proposed by "Redsandro"
Q.invoke = function (object, name /*...args*/) {
    return Q(object).dispatch("post", [name, array_slice(arguments, 2)]);
};
 
Promise.prototype.send = // XXX Mark Miller's proposed parlance
Promise.prototype.mcall = // XXX As proposed by "Redsandro"
Promise.prototype.invoke = function (name /*...args*/) {
    return this.dispatch("post", [name, array_slice(arguments, 1)]);
};
 
/**
 * Applies the promised function in a future turn.
 * @param object    promise or immediate reference for target function
 * @param args      array of application arguments
 */
Q.fapply = function (object, args) {
    return Q(object).dispatch("apply", [void 0, args]);
};
 
Promise.prototype.fapply = function (args) {
    return this.dispatch("apply", [void 0, args]);
};
 
/**
 * Calls the promised function in a future turn.
 * @param object    promise or immediate reference for target function
 * @param ...args   array of application arguments
 */
Q["try"] =
Q.fcall = function (object /* ...args*/) {
    return Q(object).dispatch("apply", [void 0, array_slice(arguments, 1)]);
};
 
Promise.prototype.fcall = function (/*...args*/) {
    return this.dispatch("apply", [void 0, array_slice(arguments)]);
};
 
/**
 * Binds the promised function, transforming return values into a fulfilled
 * promise and thrown errors into a rejected one.
 * @param object    promise or immediate reference for target function
 * @param ...args   array of application arguments
 */
Q.fbind = function (object /*...args*/) {
    var promise = Q(object);
    var args = array_slice(arguments, 1);
    return function fbound() {
        return promise.dispatch("apply", [
            this,
            args.concat(array_slice(arguments))
        ]);
    };
};
Promise.prototype.fbind = function (/*...args*/) {
    var promise = this;
    var args = array_slice(arguments);
    return function fbound() {
        return promise.dispatch("apply", [
            this,
            args.concat(array_slice(arguments))
        ]);
    };
};
 
/**
 * Requests the names of the owned properties of a promised
 * object in a future turn.
 * @param object    promise or immediate reference for target object
 * @return promise for the keys of the eventually settled object
 */
Q.keys = function (object) {
    return Q(object).dispatch("keys", []);
};
 
Promise.prototype.keys = function () {
    return this.dispatch("keys", []);
};
 
/**
 * Turns an array of promises into a promise for an array.  If any of
 * the promises gets rejected, the whole array is rejected immediately.
 * @param {Array*} an array (or promise for an array) of values (or
 * promises for values)
 * @returns a promise for an array of the corresponding values
 */
// By Mark Miller
// http://wiki.ecmascript.org/doku.php?id=strawman:concurrency&rev=1308776521#allfulfilled
Q.all = all;
function all(promises) {
    return when(promises, function (promises) {
        var pendingCount = 0;
        var deferred = defer();
        array_reduce(promises, function (undefined, promise, index) {
            var snapshot;
            if (
                isPromise(promise) &&
                (snapshot = promise.inspect()).state === "fulfilled"
            ) {
                promises[index] = snapshot.value;
            } else {
                ++pendingCount;
                when(
                    promise,
                    function (value) {
                        promises[index] = value;
                        if (--pendingCount === 0) {
                            deferred.resolve(promises);
                        }
                    },
                    deferred.reject,
                    function (progress) {
                        deferred.notify({ index: index, value: progress });
                    }
                );
            }
        }, void 0);
        if (pendingCount === 0) {
            deferred.resolve(promises);
        }
        return deferred.promise;
    });
}
 
Promise.prototype.all = function () {
    return all(this);
};
 
/**
 * Returns the first resolved promise of an array. Prior rejected promises are
 * ignored.  Rejects only if all promises are rejected.
 * @param {Array*} an array containing values or promises for values
 * @returns a promise fulfilled with the value of the first resolved promise,
 * or a rejected promise if all promises are rejected.
 */
Q.any = any;
 
function any(promises) {
    if (promises.length === 0) {
        return Q.resolve();
    }
 
    var deferred = Q.defer();
    var pendingCount = 0;
    array_reduce(promises, function (prev, current, index) {
        var promise = promises[index];
 
        pendingCount++;
 
        when(promise, onFulfilled, onRejected, onProgress);
        function onFulfilled(result) {
            deferred.resolve(result);
        }
        function onRejected() {
            pendingCount--;
            if (pendingCount === 0) {
                deferred.reject(new Error(
                    "Can't get fulfillment value from any promise, all " +
                    "promises were rejected."
                ));
            }
        }
        function onProgress(progress) {
            deferred.notify({
                index: index,
                value: progress
            });
        }
    }, undefined);
 
    return deferred.promise;
}
 
Promise.prototype.any = function () {
    return any(this);
};
 
/**
 * Waits for all promises to be settled, either fulfilled or
 * rejected.  This is distinct from `all` since that would stop
 * waiting at the first rejection.  The promise returned by
 * `allResolved` will never be rejected.
 * @param promises a promise for an array (or an array) of promises
 * (or values)
 * @return a promise for an array of promises
 */
Q.allResolved = deprecate(allResolved, "allResolved", "allSettled");
function allResolved(promises) {
    return when(promises, function (promises) {
        promises = array_map(promises, Q);
        return when(all(array_map(promises, function (promise) {
            return when(promise, noop, noop);
        })), function () {
            return promises;
        });
    });
}
 
Promise.prototype.allResolved = function () {
    return allResolved(this);
};
 
/**
 * @see Promise#allSettled
 */
Q.allSettled = allSettled;
function allSettled(promises) {
    return Q(promises).allSettled();
}
 
/**
 * Turns an array of promises into a promise for an array of their states (as
 * returned by `inspect`) when they have all settled.
 * @param {Array[Any*]} values an array (or promise for an array) of values (or
 * promises for values)
 * @returns {Array[State]} an array of states for the respective values.
 */
Promise.prototype.allSettled = function () {
    return this.then(function (promises) {
        return all(array_map(promises, function (promise) {
            promise = Q(promise);
            function regardless() {
                return promise.inspect();
            }
            return promise.then(regardless, regardless);
        }));
    });
};
 
/**
 * Captures the failure of a promise, giving an oportunity to recover
 * with a callback.  If the given promise is fulfilled, the returned
 * promise is fulfilled.
 * @param {Any*} promise for something
 * @param {Function} callback to fulfill the returned promise if the
 * given promise is rejected
 * @returns a promise for the return value of the callback
 */
Q.fail = // XXX legacy
Q["catch"] = function (object, rejected) {
    return Q(object).then(void 0, rejected);
};
 
Promise.prototype.fail = // XXX legacy
Promise.prototype["catch"] = function (rejected) {
    return this.then(void 0, rejected);
};
 
/**
 * Attaches a listener that can respond to progress notifications from a
 * promise's originating deferred. This listener receives the exact arguments
 * passed to ``deferred.notify``.
 * @param {Any*} promise for something
 * @param {Function} callback to receive any progress notifications
 * @returns the given promise, unchanged
 */
Q.progress = progress;
function progress(object, progressed) {
    return Q(object).then(void 0, void 0, progressed);
}
 
Promise.prototype.progress = function (progressed) {
    return this.then(void 0, void 0, progressed);
};
 
/**
 * Provides an opportunity to observe the settling of a promise,
 * regardless of whether the promise is fulfilled or rejected.  Forwards
 * the resolution to the returned promise when the callback is done.
 * The callback can return a promise to defer completion.
 * @param {Any*} promise
 * @param {Function} callback to observe the resolution of the given
 * promise, takes no arguments.
 * @returns a promise for the resolution of the given promise when
 * ``fin`` is done.
 */
Q.fin = // XXX legacy
Q["finally"] = function (object, callback) {
    return Q(object)["finally"](callback);
};
 
Promise.prototype.fin = // XXX legacy
Promise.prototype["finally"] = function (callback) {
    callback = Q(callback);
    return this.then(function (value) {
        return callback.fcall().then(function () {
            return value;
        });
    }, function (reason) {
        // TODO attempt to recycle the rejection with "this".
        return callback.fcall().then(function () {
            throw reason;
        });
    });
};
 
/**
 * Terminates a chain of promises, forcing rejections to be
 * thrown as exceptions.
 * @param {Any*} promise at the end of a chain of promises
 * @returns nothing
 */
Q.done = function (object, fulfilled, rejected, progress) {
    return Q(object).done(fulfilled, rejected, progress);
};
 
Promise.prototype.done = function (fulfilled, rejected, progress) {
    var onUnhandledError = function (error) {
        // forward to a future turn so that ``when``
        // does not catch it and turn it into a rejection.
        Q.nextTick(function () {
            makeStackTraceLong(error, promise);
            if (Q.onerror) {
                Q.onerror(error);
            } else {
                throw error;
            }
        });
    };
 
    // Avoid unnecessary `nextTick`ing via an unnecessary `when`.
    var promise = fulfilled || rejected || progress ?
        this.then(fulfilled, rejected, progress) :
        this;
 
    if (typeof process === "object" && process && process.domain) {
        onUnhandledError = process.domain.bind(onUnhandledError);
    }
 
    promise.then(void 0, onUnhandledError);
};
 
/**
 * Causes a promise to be rejected if it does not get fulfilled before
 * some milliseconds time out.
 * @param {Any*} promise
 * @param {Number} milliseconds timeout
 * @param {Any*} custom error message or Error object (optional)
 * @returns a promise for the resolution of the given promise if it is
 * fulfilled before the timeout, otherwise rejected.
 */
Q.timeout = function (object, ms, error) {
    return Q(object).timeout(ms, error);
};
 
Promise.prototype.timeout = function (ms, error) {
    var deferred = defer();
    var timeoutId = setTimeout(function () {
        if (!error || "string" === typeof error) {
            error = new Error(error || "Timed out after " + ms + " ms");
            error.code = "ETIMEDOUT";
        }
        deferred.reject(error);
    }, ms);
 
    this.then(function (value) {
        clearTimeout(timeoutId);
        deferred.resolve(value);
    }, function (exception) {
        clearTimeout(timeoutId);
        deferred.reject(exception);
    }, deferred.notify);
 
    return deferred.promise;
};
 
/**
 * Returns a promise for the given value (or promised value), some
 * milliseconds after it resolved. Passes rejections immediately.
 * @param {Any*} promise
 * @param {Number} milliseconds
 * @returns a promise for the resolution of the given promise after milliseconds
 * time has elapsed since the resolution of the given promise.
 * If the given promise rejects, that is passed immediately.
 */
Q.delay = function (object, timeout) {
    if (timeout === void 0) {
        timeout = object;
        object = void 0;
    }
    return Q(object).delay(timeout);
};
 
Promise.prototype.delay = function (timeout) {
    return this.then(function (value) {
        var deferred = defer();
        setTimeout(function () {
            deferred.resolve(value);
        }, timeout);
        return deferred.promise;
    });
};
 
/**
 * Passes a continuation to a Node function, which is called with the given
 * arguments provided as an array, and returns a promise.
 *
 *      Q.nfapply(FS.readFile, [__filename])
 *      .then(function (content) {
 *      })
 *
 */
Q.nfapply = function (callback, args) {
    return Q(callback).nfapply(args);
};
 
Promise.prototype.nfapply = function (args) {
    var deferred = defer();
    var nodeArgs = array_slice(args);
    nodeArgs.push(deferred.makeNodeResolver());
    this.fapply(nodeArgs).fail(deferred.reject);
    return deferred.promise;
};
 
/**
 * Passes a continuation to a Node function, which is called with the given
 * arguments provided individually, and returns a promise.
 * @example
 * Q.nfcall(FS.readFile, __filename)
 * .then(function (content) {
 * })
 *
 */
Q.nfcall = function (callback /*...args*/) {
    var args = array_slice(arguments, 1);
    return Q(callback).nfapply(args);
};
 
Promise.prototype.nfcall = function (/*...args*/) {
    var nodeArgs = array_slice(arguments);
    var deferred = defer();
    nodeArgs.push(deferred.makeNodeResolver());
    this.fapply(nodeArgs).fail(deferred.reject);
    return deferred.promise;
};
 
/**
 * Wraps a NodeJS continuation passing function and returns an equivalent
 * version that returns a promise.
 * @example
 * Q.nfbind(FS.readFile, __filename)("utf-8")
 * .then(console.log)
 * .done()
 */
Q.nfbind =
Q.denodeify = function (callback /*...args*/) {
    var baseArgs = array_slice(arguments, 1);
    return function () {
        var nodeArgs = baseArgs.concat(array_slice(arguments));
        var deferred = defer();
        nodeArgs.push(deferred.makeNodeResolver());
        Q(callback).fapply(nodeArgs).fail(deferred.reject);
        return deferred.promise;
    };
};
 
Promise.prototype.nfbind =
Promise.prototype.denodeify = function (/*...args*/) {
    var args = array_slice(arguments);
    args.unshift(this);
    return Q.denodeify.apply(void 0, args);
};
 
Q.nbind = function (callback, thisp /*...args*/) {
    var baseArgs = array_slice(arguments, 2);
    return function () {
        var nodeArgs = baseArgs.concat(array_slice(arguments));
        var deferred = defer();
        nodeArgs.push(deferred.makeNodeResolver());
        function bound() {
            return callback.apply(thisp, arguments);
        }
        Q(bound).fapply(nodeArgs).fail(deferred.reject);
        return deferred.promise;
    };
};
 
Promise.prototype.nbind = function (/*thisp, ...args*/) {
    var args = array_slice(arguments, 0);
    args.unshift(this);
    return Q.nbind.apply(void 0, args);
};
 
/**
 * Calls a method of a Node-style object that accepts a Node-style
 * callback with a given array of arguments, plus a provided callback.
 * @param object an object that has the named method
 * @param {String} name name of the method of object
 * @param {Array} args arguments to pass to the method; the callback
 * will be provided by Q and appended to these arguments.
 * @returns a promise for the value or error
 */
Q.nmapply = // XXX As proposed by "Redsandro"
Q.npost = function (object, name, args) {
    return Q(object).npost(name, args);
};
 
Promise.prototype.nmapply = // XXX As proposed by "Redsandro"
Promise.prototype.npost = function (name, args) {
    var nodeArgs = array_slice(args || []);
    var deferred = defer();
    nodeArgs.push(deferred.makeNodeResolver());
    this.dispatch("post", [name, nodeArgs]).fail(deferred.reject);
    return deferred.promise;
};
 
/**
 * Calls a method of a Node-style object that accepts a Node-style
 * callback, forwarding the given variadic arguments, plus a provided
 * callback argument.
 * @param object an object that has the named method
 * @param {String} name name of the method of object
 * @param ...args arguments to pass to the method; the callback will
 * be provided by Q and appended to these arguments.
 * @returns a promise for the value or error
 */
Q.nsend = // XXX Based on Mark Miller's proposed "send"
Q.nmcall = // XXX Based on "Redsandro's" proposal
Q.ninvoke = function (object, name /*...args*/) {
    var nodeArgs = array_slice(arguments, 2);
    var deferred = defer();
    nodeArgs.push(deferred.makeNodeResolver());
    Q(object).dispatch("post", [name, nodeArgs]).fail(deferred.reject);
    return deferred.promise;
};
 
Promise.prototype.nsend = // XXX Based on Mark Miller's proposed "send"
Promise.prototype.nmcall = // XXX Based on "Redsandro's" proposal
Promise.prototype.ninvoke = function (name /*...args*/) {
    var nodeArgs = array_slice(arguments, 1);
    var deferred = defer();
    nodeArgs.push(deferred.makeNodeResolver());
    this.dispatch("post", [name, nodeArgs]).fail(deferred.reject);
    return deferred.promise;
};
 
/**
 * If a function would like to support both Node continuation-passing-style and
 * promise-returning-style, it can end its internal promise chain with
 * `nodeify(nodeback)`, forwarding the optional nodeback argument.  If the user
 * elects to use a nodeback, the result will be sent there.  If they do not
 * pass a nodeback, they will receive the result promise.
 * @param object a result (or a promise for a result)
 * @param {Function} nodeback a Node.js-style callback
 * @returns either the promise or nothing
 */
Q.nodeify = nodeify;
function nodeify(object, nodeback) {
    return Q(object).nodeify(nodeback);
}
 
Promise.prototype.nodeify = function (nodeback) {
    if (nodeback) {
        this.then(function (value) {
            Q.nextTick(function () {
                nodeback(null, value);
            });
        }, function (error) {
            Q.nextTick(function () {
                nodeback(error);
            });
        });
    } else {
        return this;
    }
};
 
Q.noConflict = function() {
    throw new Error("Q.noConflict only works when Q is used as a global");
};
 
// All code before this point will be filtered from stack traces.
var qEndingLine = captureLine();
 
return Q;
 
});
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/

Statements: 19.7% (13 / 66)      Branches: 0% (0 / 40)      Functions: 0% (0 / 13)      Lines: 23.08% (12 / 52)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/
File Statements Branches Functions Lines
async-map.js 9.38% (3 / 32) 0% (0 / 22) 0% (0 / 7) 13.04% (3 / 23)
bind-actor.js 18.18% (2 / 11) 0% (0 / 4) 0% (0 / 2) 18.18% (2 / 11)
chain.js 25% (5 / 20) 0% (0 / 14) 0% (0 / 4) 26.67% (4 / 15)
slide.js 100% (3 / 3) 100% (0 / 0) 100% (0 / 0) 100% (3 / 3)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/async-map.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/async-map.js

Statements: 9.38% (3 / 32)      Branches: 0% (0 / 22)      Functions: 0% (0 / 7)      Lines: 13.04% (3 / 23)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56                      1   1                           1                                                        
 
/*
usage:
 
// do something to a list of things
asyncMap(myListOfStuff, function (thing, cb) { doSomething(thing.foo, cb) }, cb)
// do more than one thing to each item
asyncMap(list, fooFn, barFn, cb)
 
*/
 
module.exports = asyncMap
 
function asyncMap () {
  var steps = Array.prototype.slice.call(arguments)
    , list = steps.shift() || []
    , cb_ = steps.pop()
  if (typeof cb_ !== "function") throw new Error(
    "No callback provided to asyncMap")
  if (!list) return cb_(null, [])
  if (!Array.isArray(list)) list = [list]
  var n = steps.length
    , data = [] // 2d array
    , errState = null
    , l = list.length
    , a = l * n
  if (!a) return cb_(null, [])
  function cb (er) {
    if (er && !errState) errState = er
 
    var argLen = arguments.length
    for (var i = 1; i < argLen; i ++) if (arguments[i] !== undefined) {
      data[i - 1] = (data[i - 1] || []).concat(arguments[i])
    }
    // see if any new things have been added.
    if (list.length > l) {
      var newList = list.slice(l)
      a += (list.length - l) * n
      l = list.length
      process.nextTick(function () {
        newList.forEach(function (ar) {
          steps.forEach(function (fn) { fn(ar, cb) })
        })
      })
    }
 
    if (--a === 0) cb_.apply(null, [errState].concat(data))
  }
  // expect the supplied cb function to be called
  // "n" times for each thing in the array.
  list.forEach(function (ar) {
    steps.forEach(function (fn) { fn(ar, cb) })
  })
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/bind-actor.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/bind-actor.js

Statements: 18.18% (2 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1                                
module.exports = bindActor
function bindActor () {
  var args = 
        Array.prototype.slice.call
        (arguments) // jswtf.
    , obj = null
    , fn
  if (typeof args[0] === "object") {
    obj = args.shift()
    fn = args.shift()
    if (typeof fn === "string")
      fn = obj[ fn ]
  } else fn = args.shift()
  return function (cb) {
    fn.apply(obj, args.concat(cb)) }
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/chain.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/chain.js

Statements: 25% (5 / 20)      Branches: 0% (0 / 14)      Functions: 0% (0 / 4)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1 1 1                                    
module.exports = chain
var bindActor = require("./bind-actor.js")
chain.first = {} ; chain.last = {}
function chain (things, cb) {
  var res = []
  ;(function LOOP (i, len) {
    if (i >= len) return cb(null,res)
    if (Array.isArray(things[i]))
      things[i] = bindActor.apply(null,
        things[i].map(function(i){
          return (i===chain.first) ? res[0]
           : (i===chain.last)
             ? res[res.length - 1] : i }))
    if (!things[i]) return LOOP(i + 1, len)
    things[i](function (er, data) {
      if (er) return cb(er, res)
      if (data !== undefined) res = res.concat(data)
      LOOP(i + 1, len)
    })
  })(0, things.length) }
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/slide.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/slide/lib/slide.js

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (3 / 3)      Ignored: none     

1 2 3 4 51 1 1    
exports.asyncMap = require("./async-map")
exports.bindActor = require("./bind-actor")
exports.chain = require("./chain")
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/untildify/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/untildify/

Statements: 83.33% (5 / 6)      Branches: 50% (2 / 4)      Functions: 100% (1 / 1)      Lines: 83.33% (5 / 6)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/untildify/
File Statements Branches Functions Lines
index.js 83.33% (5 / 6) 50% (2 / 4) 100% (1 / 1) 83.33% (5 / 6)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/untildify/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/untildify/index.js

Statements: 83.33% (5 / 6)      Branches: 50% (2 / 4)      Functions: 100% (1 / 1)      Lines: 83.33% (5 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13  1 1   1 24       24      
'use strict';
var osHomedir = require('os-homedir');
var home = osHomedir();
 
module.exports = function (str) {
	Iif (typeof str !== 'string') {
		throw new TypeError('Expected a string');
	}
 
	return home ? str.replace(/^~($|\/|\\)/, home + '$1') : str;
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/uuid/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/uuid/

Statements: 29.49% (23 / 78)      Branches: 0% (0 / 54)      Functions: 16.67% (1 / 6)      Lines: 29.49% (23 / 78)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/uuid/
File Statements Branches Functions Lines
rng.js 100% (3 / 3) 100% (0 / 0) 100% (1 / 1) 100% (3 / 3)
uuid.js 26.67% (20 / 75) 0% (0 / 54) 0% (0 / 5) 26.67% (20 / 75)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/uuid/rng.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/uuid/rng.js

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (3 / 3)      Ignored: none     

1 2 3 4 5 61 1 1      
var rb = require('crypto').randomBytes;
module.exports = function() {
  return rb(16);
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/uuid/uuid.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/uuid/uuid.js

Statements: 26.67% (20 / 75)      Branches: 0% (0 / 54)      Functions: 0% (0 / 5)      Lines: 26.67% (20 / 75)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185                1     1 1 1 256 256       1                                     1                                   1     1           1     1     1                                                                                                                                                           1                                                     1 1 1 1 1   1    
//     uuid.js
//
//     Copyright (c) 2010-2012 Robert Kieffer
//     MIT License - http://opensource.org/licenses/mit-license.php
 
// Unique ID creation requires a high quality random # generator.  We feature
// detect to determine the best RNG source, normalizing to a function that
// returns 128-bits of randomness, since that's what's usually required
var _rng = require('./rng');
 
// Maps for number <-> hex string conversion
var _byteToHex = [];
var _hexToByte = {};
for (var i = 0; i < 256; i++) {
  _byteToHex[i] = (i + 0x100).toString(16).substr(1);
  _hexToByte[_byteToHex[i]] = i;
}
 
// **`parse()` - Parse a UUID into it's component bytes**
function parse(s, buf, offset) {
  var i = (buf && offset) || 0, ii = 0;
 
  buf = buf || [];
  s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
    if (ii < 16) { // Don't overflow!
      buf[i + ii++] = _hexToByte[oct];
    }
  });
 
  // Zero out remaining bytes if string was short
  while (ii < 16) {
    buf[i + ii++] = 0;
  }
 
  return buf;
}
 
// **`unparse()` - Convert UUID byte array (ala parse()) into a string**
function unparse(buf, offset) {
  var i = offset || 0, bth = _byteToHex;
  return  bth[buf[i++]] + bth[buf[i++]] +
          bth[buf[i++]] + bth[buf[i++]] + '-' +
          bth[buf[i++]] + bth[buf[i++]] + '-' +
          bth[buf[i++]] + bth[buf[i++]] + '-' +
          bth[buf[i++]] + bth[buf[i++]] + '-' +
          bth[buf[i++]] + bth[buf[i++]] +
          bth[buf[i++]] + bth[buf[i++]] +
          bth[buf[i++]] + bth[buf[i++]];
}
 
// **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
 
// random #'s we need to init node and clockseq
var _seedBytes = _rng();
 
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
var _nodeId = [
  _seedBytes[0] | 0x01,
  _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
];
 
// Per 4.2.2, randomize (14 bit) clockseq
var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
 
// Previous uuid creation time
var _lastMSecs = 0, _lastNSecs = 0;
 
// See https://github.com/broofa/node-uuid for API details
function v1(options, buf, offset) {
  var i = buf && offset || 0;
  var b = buf || [];
 
  options = options || {};
 
  var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
 
  // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  // (1582-10-15 00:00).  JSNumbers aren't precise enough for this, so
  // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
 
  // Per 4.2.1.2, use count of uuid's generated during the current clock
  // cycle to simulate higher resolution clock
  var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
 
  // Time since last uuid creation (in msecs)
  var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
 
  // Per 4.2.1.2, Bump clockseq on clock regression
  if (dt < 0 && options.clockseq === undefined) {
    clockseq = clockseq + 1 & 0x3fff;
  }
 
  // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  // time interval
  if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
    nsecs = 0;
  }
 
  // Per 4.2.1.2 Throw error if too many uuids are requested
  if (nsecs >= 10000) {
    throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  }
 
  _lastMSecs = msecs;
  _lastNSecs = nsecs;
  _clockseq = clockseq;
 
  // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  msecs += 12219292800000;
 
  // `time_low`
  var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  b[i++] = tl >>> 24 & 0xff;
  b[i++] = tl >>> 16 & 0xff;
  b[i++] = tl >>> 8 & 0xff;
  b[i++] = tl & 0xff;
 
  // `time_mid`
  var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
  b[i++] = tmh >>> 8 & 0xff;
  b[i++] = tmh & 0xff;
 
  // `time_high_and_version`
  b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  b[i++] = tmh >>> 16 & 0xff;
 
  // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  b[i++] = clockseq >>> 8 | 0x80;
 
  // `clock_seq_low`
  b[i++] = clockseq & 0xff;
 
  // `node`
  var node = options.node || _nodeId;
  for (var n = 0; n < 6; n++) {
    b[i + n] = node[n];
  }
 
  return buf ? buf : unparse(b);
}
 
// **`v4()` - Generate random UUID**
 
// See https://github.com/broofa/node-uuid for API details
function v4(options, buf, offset) {
  // Deprecated - 'format' argument, as supported in v1.2
  var i = buf && offset || 0;
 
  if (typeof(options) == 'string') {
    buf = options == 'binary' ? new Array(16) : null;
    options = null;
  }
  options = options || {};
 
  var rnds = options.random || (options.rng || _rng)();
 
  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  rnds[6] = (rnds[6] & 0x0f) | 0x40;
  rnds[8] = (rnds[8] & 0x3f) | 0x80;
 
  // Copy bytes to buffer, if provided
  if (buf) {
    for (var ii = 0; ii < 16; ii++) {
      buf[i + ii] = rnds[ii];
    }
  }
 
  return buf || unparse(rnds);
}
 
// Export public API
var uuid = v4;
uuid.v1 = v1;
uuid.v4 = v4;
uuid.parse = parse;
uuid.unparse = unparse;
 
module.exports = uuid;
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/wordwrap/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/wordwrap/

Statements: 7.14% (3 / 42)      Branches: 0% (0 / 22)      Functions: 0% (0 / 7)      Lines: 7.5% (3 / 40)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/wordwrap/
File Statements Branches Functions Lines
index.js 7.14% (3 / 42) 0% (0 / 22) 0% (0 / 7) 7.5% (3 / 40)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/wordwrap/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/wordwrap/index.js

Statements: 7.14% (3 / 42)      Branches: 0% (0 / 22)      Functions: 0% (0 / 7)      Lines: 7.5% (3 / 40)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 781                                                                                                                                             1   1        
var wordwrap = module.exports = function (start, stop, params) {
    if (typeof start === 'object') {
        params = start;
        start = params.start;
        stop = params.stop;
    }
    
    if (typeof stop === 'object') {
        params = stop;
        start = start || params.start;
        stop = undefined;
    }
    
    if (!stop) {
        stop = start;
        start = 0;
    }
    
    if (!params) params = {};
    var mode = params.mode || 'soft';
    var re = mode === 'hard' ? /\b/ : /(\S+\s+)/;
    
    return function (text) {
        var chunks = text.toString()
            .split(re)
            .reduce(function (acc, x) {
                if (mode === 'hard') {
                    for (var i = 0; i < x.length; i += stop - start) {
                        acc.push(x.slice(i, i + stop - start));
                    }
                }
                else acc.push(x)
                return acc;
            }, [])
        ;
        
        return chunks.reduce(function (lines, rawChunk) {
            if (rawChunk === '') return lines;
            
            var chunk = rawChunk.replace(/\t/g, '    ');
            
            var i = lines.length - 1;
            if (lines[i].length + chunk.length > stop) {
                lines[i] = lines[i].replace(/\s+$/, '');
                
                chunk.split(/\n/).forEach(function (c) {
                    lines.push(
                        new Array(start + 1).join(' ')
                        + c.replace(/^\s+/, '')
                    );
                });
            }
            else if (chunk.match(/\n/)) {
                var xs = chunk.split(/\n/);
                lines[i] += xs.shift();
                xs.forEach(function (c) {
                    lines.push(
                        new Array(start + 1).join(' ')
                        + c.replace(/^\s+/, '')
                    );
                });
            }
            else {
                lines[i] += chunk;
            }
            
            return lines;
        }, [ new Array(start + 1).join(' ') ]).join('\n');
    };
};
 
wordwrap.soft = wordwrap;
 
wordwrap.hard = function (start, stop) {
    return wordwrap(start, stop, { mode : 'hard' });
};
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/wrappy/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/wrappy/

Statements: 36.84% (7 / 19)      Branches: 40% (4 / 10)      Functions: 25% (1 / 4)      Lines: 38.89% (7 / 18)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/wrappy/
File Statements Branches Functions Lines
wrappy.js 36.84% (7 / 19) 40% (4 / 10) 25% (1 / 4) 38.89% (7 / 18)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/wrappy/wrappy.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/wrappy/wrappy.js

Statements: 36.84% (7 / 19)      Branches: 40% (4 / 10)      Functions: 25% (1 / 4)      Lines: 38.89% (7 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35          1 1 2   2     2       2   1                                
// Returns a wrapper function that returns a wrapped callback
// The wrapper function should do some stuff, and return a
// presumably different callback function.
// This makes sure that own properties are retained, so that
// decorations and such are not lost along the way.
module.exports = wrappy
function wrappy (fn, cb) {
  Iif (fn && cb) return wrappy(fn)(cb)
 
  Iif (typeof fn !== 'function')
    throw new TypeError('need wrapper function')
 
  Object.keys(fn).forEach(function (k) {
    wrapper[k] = fn[k]
  })
 
  return wrapper
 
  function wrapper() {
    var args = new Array(arguments.length)
    for (var i = 0; i < args.length; i++) {
      args[i] = arguments[i]
    }
    var ret = fn.apply(this, args)
    var cb = args[args.length-1]
    if (typeof ret === 'function' && ret !== cb) {
      Object.keys(cb).forEach(function (k) {
        ret[k] = cb[k]
      })
    }
    return ret
  }
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/write-file-atomic/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/write-file-atomic/

Statements: 57.41% (31 / 54)      Branches: 27.66% (13 / 47)      Functions: 37.5% (3 / 8)      Lines: 59.57% (28 / 47)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/write-file-atomic/
File Statements Branches Functions Lines
index.js 57.41% (31 / 54) 27.66% (13 / 47) 37.5% (3 / 8) 59.57% (28 / 47)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/write-file-atomic/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/write-file-atomic/index.js

Statements: 57.41% (31 / 54)      Branches: 27.66% (13 / 47)      Functions: 37.5% (3 / 8)      Lines: 59.57% (28 / 47)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88  1 1 1 1   1 1 3 1   1 1 1     1                                                 1                         1 1 1   1 1     1 1   1 1     1 1             1 1 1 1              
'use strict'
var fs = require('graceful-fs')
var chain = require('slide').chain
var MurmurHash3 = require('imurmurhash')
var extend = Object.assign || require('util')._extend
 
function murmurhex () {
  var hash = new MurmurHash3()
  for (var ii = 0; ii < arguments.length; ++ii) hash.hash('' + arguments[ii])
  return hash.result()
}
var invocations = 0
var getTmpname = function (filename) {
  return filename + '.' + murmurhex(__filename, process.pid, ++invocations)
}
 
module.exports = function writeFile (filename, data, options, callback) {
  if (options instanceof Function) {
    callback = options
    options = null
  }
  if (!options) options = {}
  var tmpfile = getTmpname(filename)
 
  if (options.mode && options.chmod) {
    return thenWriteFile()
  } else {
    // Either mode or chown is not explicitly set
    // Default behavior is to copy it from original file
    return fs.stat(filename, function (err, stats) {
      options = extend({}, options)
      if (!err && stats && !options.mode) {
        options.mode = stats.mode
      }
      if (!err && stats && !options.chown && process.getuid) {
        options.chown = { uid: stats.uid, gid: stats.gid }
      }
      return thenWriteFile()
    })
  }
 
  function thenWriteFile () {
    chain([
      [fs, fs.writeFile, tmpfile, data, options.encoding || 'utf8'],
      options.mode && [fs, fs.chmod, tmpfile, options.mode],
      options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid],
      [fs, fs.rename, tmpfile, filename]
    ], function (err) {
      err ? fs.unlink(tmpfile, function () { callback(err) })
        : callback()
    })
  }
}
 
module.exports.sync = function writeFileSync (filename, data, options) {
  Iif (!options) options = {}
  var tmpfile = getTmpname(filename)
 
  try {
    Eif (!options.mode || !options.chmod) {
      // Either mode or chown is not explicitly set
      // Default behavior is to copy it from original file
      try {
        var stats = fs.statSync(filename)
 
        options = extend({}, options)
        Iif (!options.mode) {
          options.mode = stats.mode
        }
        Eif (!options.chown && process.getuid) {
          options.chown = { uid: stats.uid, gid: stats.gid }
        }
      } catch (ex) {
        // ignore stat errors
      }
    }
 
    fs.writeFileSync(tmpfile, data, options.encoding || 'utf8')
    Eif (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid)
    Eif (options.mode) fs.chmodSync(tmpfile, options.mode)
    fs.renameSync(tmpfile, filename)
  } catch (err) {
    try { fs.unlinkSync(tmpfile) } catch (e) {}
    throw err
  }
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/xdg-basedir/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/xdg-basedir/

Statements: 100% (14 / 14)      Branches: 72.73% (16 / 22)      Functions: 100% (0 / 0)      Lines: 100% (14 / 14)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/node_modules/xdg-basedir/
File Statements Branches Functions Lines
index.js 100% (14 / 14) 72.73% (16 / 22) 100% (0 / 0) 100% (14 / 14)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/xdg-basedir/index.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/node_modules/xdg-basedir/index.js

Statements: 100% (14 / 14)      Branches: 72.73% (16 / 22)      Functions: 100% (0 / 0)      Lines: 100% (14 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29  1 1 1 1   1     1     1   1   1   1 1     1   1 1      
'use strict';
var path = require('path');
var osHomedir = require('os-homedir');
var home = osHomedir();
var env = process.env;
 
exports.data = env.XDG_DATA_HOME ||
	(home ? path.join(home, '.local', 'share') : null);
 
exports.config = env.XDG_CONFIG_HOME ||
	(home ? path.join(home, '.config') : null);
 
exports.cache = env.XDG_CACHE_HOME || (home ? path.join(home, '.cache') : null);
 
exports.runtime = env.XDG_RUNTIME_DIR || null;
 
exports.dataDirs = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':');
 
Eif (exports.data) {
	exports.dataDirs.unshift(exports.data);
}
 
exports.configDirs = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':');
 
Eif (exports.config) {
	exports.configDirs.unshift(exports.config);
}
 
 
Code coverage report for node-npmtest-bower/node_modules/bower/lib/util/

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/util/

Statements: 100% (18 / 18)      Branches: 100% (8 / 8)      Functions: 100% (3 / 3)      Lines: 100% (18 / 18)      Ignored: none     

All files » node-npmtest-bower/node_modules/bower/lib/util/
File Statements Branches Functions Lines
abbreviations.js 100% (18 / 18) 100% (8 / 8) 100% (3 / 3) 100% (18 / 18)
Code coverage report for node-npmtest-bower/node_modules/bower/lib/util/abbreviations.js

npmtest-bower (v0.0.1)

Code coverage report for node-npmtest-bower/node_modules/bower/lib/util/abbreviations.js

Statements: 100% (18 / 18)      Branches: 100% (8 / 8)      Functions: 100% (3 / 3)      Lines: 100% (18 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1   1 2 2   2 19   19   19 1       2     1 1   1 1 1 1   1      
var abbrev = require('abbrev');
var mout = require('mout');
 
function expandNames(obj, prefix, stack) {
    prefix = prefix || '';
    stack = stack || [];
 
    mout.object.forOwn(obj, function (value, name) {
        name = prefix + name;
 
        stack.push(name);
 
        if (typeof value === 'object' && !value.line) {
            expandNames(value, name + ' ', stack);
        }
    });
 
    return stack;
}
 
module.exports = function (commands) {
    var abbreviations = abbrev(expandNames(commands));
 
    abbreviations.i = 'install';
    abbreviations.rm = 'uninstall';
    abbreviations.unlink = 'uninstall';
    abbreviations.ls = 'list';
 
    return abbreviations;
};